[FileSystem] DeleteFile returns true or false now

FileSystem::DeleteFile: function returns the boolean from Game::Remove(<path>);
This commit is contained in:
Joelrau 2020-09-02 13:13:05 +03:00 committed by Maurice Heumann
parent 86bfc41812
commit 49c2ccd700
2 changed files with 3 additions and 3 deletions

View File

@ -172,11 +172,11 @@ namespace Components
return fileList;
}
void FileSystem::DeleteFile(const std::string& folder, const std::string& file)
bool FileSystem::DeleteFile(const std::string& folder, const std::string& file)
{
char path[MAX_PATH] = { 0 };
Game::FS_BuildPathToFile(Dvar::Var("fs_basepath").get<const char*>(), reinterpret_cast<char*>(0x63D0BB8), Utils::String::VA("%s/%s", folder.data(), file.data()), reinterpret_cast<char**>(&path));
Game::FS_Remove(path);
return Game::FS_Remove(path);
}
int FileSystem::ReadFile(const char* path, char** buffer)

View File

@ -90,7 +90,7 @@ namespace Components
static std::vector<std::string> GetFileList(const std::string& path, const std::string& extension);
static std::vector<std::string> GetSysFileList(const std::string& path, const std::string& extension, bool folders = false);
static void DeleteFile(const std::string& folder, const std::string& file);
static bool DeleteFile(const std::string& folder, const std::string& file);
private:
static std::mutex Mutex;