很早之前的修改,我也忘了改什么了
This commit is contained in:
56
Source/Arona/PeakFile/PeakFileManager.cpp
Normal file
56
Source/Arona/PeakFile/PeakFileManager.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user