improve proj

- remove VTImage.hpp to make sure stb image do not need external project to ref.
- finish CKStateChunk write part. add some compatibilty code.
- add debugger pause function
- add filename getter for CKPathManager.
This commit is contained in:
2023-09-24 20:56:23 +08:00
parent 6870fca911
commit b2d0b743cb
15 changed files with 96 additions and 52 deletions

View File

@ -99,6 +99,14 @@ namespace LibCmo::CK2::MgrImpls {
return false;
}
void CKPathManager::GetFileName(XContainer::XString& u8path) {
std::filesystem::path filepath;
EncodingHelper::U8PathToStdPath(filepath, u8path.c_str());
auto result = filepath.filename();
EncodingHelper::StdPathToU8Path(u8path, result);
}
void CKPathManager::GetExtension(XContainer::XString& u8path) {
std::filesystem::path filepath;
EncodingHelper::U8PathToStdPath(filepath, u8path.c_str());

View File

@ -53,9 +53,15 @@ namespace LibCmo::CK2::MgrImpls {
*/
bool ResolveFileName(XContainer::XString& u8_filename);
/**
* @brief Get file name part of given path.
* @param u8path[inout] The given path. overwritten by the gotten file name.
*/
void GetFileName(XContainer::XString& u8path);
/**
* @brief Returns the file extension including period (.)
* @param u8path[inout] The given path. overwritten by the gotten extension. set to blank when failed.
* @param u8path[inout] The given path. overwritten by the gotten extension.
*/
void GetExtension(XContainer::XString& u8path);