libcmo21/LibCmo/CK2/MgrImpls/CKPathManager.hpp

44 lines
1002 B
C++
Raw Normal View History

2023-09-04 22:58:53 +08:00
#pragma once
#include "../../VTAll.hpp"
#include "CKBaseManager.hpp"
2023-09-06 10:42:23 +08:00
#include <filesystem>
2023-09-04 22:58:53 +08:00
namespace LibCmo::CK2::MgrImpls {
class CKPathManager : public CKBaseManager {
public:
2023-09-06 10:42:23 +08:00
CKPathManager(CKContext* ctx);
virtual ~CKPathManager();
2023-09-04 22:58:53 +08:00
LIBCMO_DISABLE_COPY_MOVE(CKPathManager);
2023-09-06 10:42:23 +08:00
/**
* @brief Set the temp folder of current context.
* @param u8_temp
*/
void SetTempFolder(CKSTRING u8_temp);
/**
* @brief Get current temp folder.
* @return
*/
std::string GetTempFolder();
/**
* @brief Get the path of temp file.
* @param u8_filename The relative path of file.
* @return The path of given path based on temp folder.
*/
std::string GetTempFilePath(CKSTRING u8_filename);
/**
* @brief Finds a file in the paths
* @param u8_filename[inout] The given file path. overwritten by the final path if success.
* @return true if success
*/
bool ResolveFileName(std::string& u8_filename);
2023-09-04 22:58:53 +08:00
protected:
2023-09-06 10:42:23 +08:00
std::filesystem::path m_TempFolder;
2023-09-04 22:58:53 +08:00
};
}