write shit

This commit is contained in:
2023-09-10 21:33:43 +08:00
parent e907c18f35
commit 1e0ed360bd
12 changed files with 415 additions and 32 deletions

View File

@ -94,5 +94,13 @@ namespace LibCmo::CK2::MgrImpls {
return false;
}
void CKPathManager::GetExtension(std::string& u8path) {
std::filesystem::path filepath;
EncodingHelper::U8PathToStdPath(filepath, u8path.c_str());
auto result = filepath.extension();
EncodingHelper::StdPathToU8Path(u8path, result);
}
}

View File

@ -53,6 +53,12 @@ namespace LibCmo::CK2::MgrImpls {
*/
bool ResolveFileName(std::string& u8_filename);
/**
* @brief Returns the file extension including period (.)
* @param u8path[inout] The given path. overwritten by the gotten extension. set to blank when failed.
*/
void GetExtension(std::string& u8path);
protected:
std::filesystem::path m_TempFolder;
XContainer::XArray<std::filesystem::path> m_ExtraPathes;