2023-01-02 13:17:18 -06:00
|
|
|
#ifndef UTIL_S_FILE_HPP
|
|
|
|
|
#define UTIL_S_FILE_HPP
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
class SArchive;
|
|
|
|
|
struct SOVERLAPPED;
|
|
|
|
|
struct TASYNCPARAMBLOCK;
|
2023-12-04 19:15:37 -05:00
|
|
|
namespace Blizzard {
|
|
|
|
|
namespace File {
|
|
|
|
|
class StreamRecord;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-02 13:17:18 -06:00
|
|
|
|
|
|
|
|
class SFile {
|
|
|
|
|
public:
|
|
|
|
|
// Static functions
|
|
|
|
|
static int32_t Close(SFile*);
|
|
|
|
|
static size_t GetFileSize(SFile*, size_t*);
|
|
|
|
|
static int32_t IsStreamingMode(void);
|
|
|
|
|
static int32_t Load(SArchive*, const char*, void**, size_t*, size_t, uint32_t, SOVERLAPPED*);
|
|
|
|
|
static int32_t Open(const char*, SFile**);
|
|
|
|
|
static int32_t OpenEx(SArchive*, const char*, uint32_t, SFile**);
|
|
|
|
|
static int32_t Read(SFile*, void*, size_t, size_t*, SOVERLAPPED*, TASYNCPARAMBLOCK*);
|
|
|
|
|
static int32_t Unload(void*);
|
2023-08-24 20:51:30 -04:00
|
|
|
static int32_t SetBasePath(const char* path);
|
|
|
|
|
static int32_t SetDataPath(const char* path);
|
|
|
|
|
static int32_t GetBasePath(char* path, size_t capacity);
|
|
|
|
|
static int32_t GetDataPath(char* path, size_t capacity);
|
2023-01-02 13:17:18 -06:00
|
|
|
|
|
|
|
|
// Member variables
|
|
|
|
|
const char* m_filename;
|
2023-12-04 18:54:37 -05:00
|
|
|
Blizzard::File::StreamRecord* m_stream; // TODO Proper implementation
|
|
|
|
|
uint64_t m_size; // TODO Proper implementation
|
2023-01-02 13:17:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|