57 lines
966 B
C++
57 lines
966 B
C++
#include "PeakFileManager.h"
|
|
|
|
#include "Async.h"
|
|
#include "FileHelper.h"
|
|
|
|
void FPeakFileManager::Init()
|
|
{
|
|
// 开一个线程加载PeakFile
|
|
}
|
|
|
|
void FPeakFileManager::LoadPeakFile(const FString& Path)
|
|
{
|
|
|
|
}
|
|
|
|
void FPeakFileManager::LoadCache()
|
|
{
|
|
FString FilePath = GetCacheDirMapFilePath();
|
|
if (!FPaths::FileExists(FilePath))
|
|
{
|
|
// 建立新的缓存
|
|
GenerateCache();
|
|
}
|
|
}
|
|
|
|
void FPeakFileManager::GenerateCache()
|
|
{
|
|
// const FString& FileName = GetCacheDirMapFilePath();
|
|
|
|
// Async(EAsyncExecution::Thread, [this]()
|
|
// {
|
|
// Processing = true;
|
|
// GenerateCacheTask();
|
|
// Processing = false;
|
|
// });
|
|
|
|
// FFileHelper::SaveStringToFile(, *FileName);
|
|
}
|
|
|
|
FString FPeakFileManager::GetCacheDirPath()
|
|
{
|
|
return FPaths::ProjectContentDir() / TEXT("Cache") / TEXT("PeakFile");
|
|
}
|
|
|
|
FString FPeakFileManager::GetCacheDirMapFilePath()
|
|
{
|
|
return GetCacheDirPath() / TEXT("Map.json");
|
|
}
|
|
|
|
void FPeakFileManager::GenerateCacheTask()
|
|
{
|
|
while (!Processing)
|
|
{
|
|
|
|
}
|
|
}
|