添加虚拟文件系统(VFS)类以支持压缩文件的读取和管理,更新CMake配置以包含libzip子模块
This commit is contained in:
26
vfs.hpp
Normal file
26
vfs.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "zip.h"
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <Windows.h>
|
||||
|
||||
class VFS {
|
||||
public:
|
||||
VFS();
|
||||
~VFS();
|
||||
bool AddArchive(std::string path);
|
||||
bool ContainsFile(std::string path);
|
||||
bool ContainsFile(std::wstring path);
|
||||
bool ContainsHandle(HANDLE hFile);
|
||||
HANDLE CreateFileW(std::wstring path);
|
||||
bool ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead);
|
||||
void CloseHandle(HANDLE hFile);
|
||||
DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
|
||||
DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
|
||||
std::unordered_map<std::string, zip_uint64_t> files;
|
||||
std::string GetBasePath();
|
||||
private:
|
||||
std::string base_path;
|
||||
std::list<zip_t*> archives;
|
||||
std::unordered_map<HANDLE, std::string> handles;
|
||||
};
|
||||
Reference in New Issue
Block a user