32 lines
804 B
C++
32 lines
804 B
C++
#include "physfs_test_utils.h"
|
|
#include "PhysFSManager.h"
|
|
|
|
static bool g_initialized = false;
|
|
|
|
bool InitPhysFSTest(const std::filesystem::path& writeDir) {
|
|
if (!g_initialized) {
|
|
if (!PhysFSManager::Initialize("unit_tests")) {
|
|
return false;
|
|
}
|
|
g_initialized = true;
|
|
}
|
|
|
|
PhysFSManager::SetWriteDir(writeDir.string());
|
|
return true;
|
|
}
|
|
|
|
bool MountPhysFSTest(const std::filesystem::path& realPath, const std::string& mountPoint) {
|
|
return PhysFSManager::MountPath(realPath.string(), mountPoint, true);
|
|
}
|
|
|
|
bool UnmountPhysFSTest(const std::filesystem::path& realPath) {
|
|
return PhysFSManager::UnmountPath(realPath.string());
|
|
}
|
|
|
|
void ShutdownPhysFSTest() {
|
|
if (g_initialized) {
|
|
PhysFSManager::Shutdown();
|
|
g_initialized = false;
|
|
}
|
|
}
|