feat(client): add PatchFiles class

This commit is contained in:
VDm 2025-03-29 22:58:53 +04:00
parent 4a74c722a4
commit 8d54e8ad0b
6 changed files with 124 additions and 8 deletions

View file

@ -8,8 +8,9 @@
#include <bc/file/File.hpp>
#include "util/Filesystem.hpp"
static char s_basepath[STORM_MAX_PATH] = {0};
static char s_datapath[STORM_MAX_PATH] = {0};
static char s_basepath[STORM_MAX_PATH] = { 0 };
static char s_datapath[STORM_MAX_PATH] = { 0 };
static char s_datapath2[STORM_MAX_PATH] = { 0 };
// TODO Proper implementation
int32_t SFile::Close(SFile* file) {
@ -279,3 +280,17 @@ int32_t SFile::GetDataPath(char* buffer, size_t bufferchars) {
SStrCopy(buffer, s_datapath, bufferchars);
return 1;
}
int32_t SFile::SetDataPathAlternate(const char* path) {
SStrCopy(s_datapath2, path, STORM_MAX_PATH);
size_t length = SStrLen(s_datapath2);
if (length && s_datapath2[length - 1] != '\\' && s_datapath2[length - 1] != '/') {
SStrPack(s_datapath2, "\\", STORM_MAX_PATH);
}
return 1;
}
int32_t SFile::RebuildHash() {
// TODO
return 1;
}

View file

@ -39,6 +39,8 @@ class SFile {
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);
static int32_t SetDataPathAlternate(const char* path);
static int32_t RebuildHash();
// Member variables
SFILE_TYPE m_type;