mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
chore(file): add initial file headers (#107)
This commit is contained in:
parent
ca6dd93c84
commit
cac1cf7a1f
2 changed files with 50 additions and 0 deletions
25
storm/File.hpp
Normal file
25
storm/File.hpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef STORM_FILE_HPP
|
||||
#define STORM_FILE_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include "storm/Core.hpp"
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
#include <Windows.h>
|
||||
#else
|
||||
typedef void* HANDLE;
|
||||
typedef uint32_t DWORD;
|
||||
typedef uint32_t* LPDWORD;
|
||||
typedef int32_t LONG;
|
||||
typedef void* LPOVERLAPPED;
|
||||
#endif
|
||||
|
||||
bool STORMAPI SFileOpenArchive(const char* mpqName, DWORD priority, DWORD flags, HANDLE* archive);
|
||||
bool STORMAPI SFileCloseArchive(HANDLE archive);
|
||||
bool STORMAPI SFileOpenFileEx(HANDLE archive, const char* fileName, DWORD searchScope, HANDLE* file);
|
||||
bool STORMAPI SFileReadFile(HANDLE file, void* buffer, DWORD toRead, LPDWORD read, LPOVERLAPPED overlapped);
|
||||
DWORD STORMAPI SFileGetFileSize(HANDLE file, LPDWORD fileSizeHigh);
|
||||
DWORD STORMAPI SFileSetFilePointer(HANDLE file, LONG filePos, LONG* filePosHigh, DWORD moveMethod);
|
||||
bool STORMAPI SFileCloseFile(HANDLE file);
|
||||
|
||||
#endif
|
||||
25
storm/file/SFile.hpp
Normal file
25
storm/file/SFile.hpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef STORM_FILE_SFILE_HPP
|
||||
#define STORM_FILE_SFILE_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
class SArchive;
|
||||
struct SOVERLAPPED;
|
||||
struct TASYNCPARAMBLOCK;
|
||||
|
||||
class SFile {
|
||||
public:
|
||||
static int32_t Close(SFile*);
|
||||
static int32_t FileExists(const char* filename);
|
||||
static size_t GetFileSize(SFile*, size_t*);
|
||||
static int32_t IsStreamingMode();
|
||||
static int32_t IsStreamingTrial();
|
||||
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*);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue