2023-02-25 22:58:28 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CKDefines.hpp"
|
2023-02-26 21:48:03 +08:00
|
|
|
#include "CKObjects.hpp"
|
2023-02-25 22:58:28 +08:00
|
|
|
#include "VTEncoding.hpp"
|
|
|
|
#include <filesystem>
|
|
|
|
|
2023-02-26 21:48:03 +08:00
|
|
|
namespace LibCmo::CK2 {
|
2023-02-25 22:58:28 +08:00
|
|
|
|
|
|
|
class CKMinContext {
|
|
|
|
public:
|
|
|
|
CKMinContext();
|
|
|
|
CKMinContext(const CKMinContext&) = delete;
|
|
|
|
CKMinContext& operator=(const CKMinContext&) = delete;
|
|
|
|
~CKMinContext();
|
|
|
|
|
2023-02-26 21:48:03 +08:00
|
|
|
using PrintCallback = void (*)(std::string&);
|
2023-02-25 22:58:28 +08:00
|
|
|
void Printf(CKSTRING fmt, ...);
|
2023-02-26 21:48:03 +08:00
|
|
|
void SetPrintCallback(PrintCallback cb);
|
2023-02-25 22:58:28 +08:00
|
|
|
|
2023-02-26 21:48:03 +08:00
|
|
|
CKObjectImplements::CKObject* CreateCKObject(CK_ID id, CK_CLASSID cls, CKSTRING name);
|
|
|
|
CKObjectImplements::CKObject* GetCKObject(CK_ID id);
|
|
|
|
void DestroyCKObject(CKObjectImplements::CKObject* obj);
|
2023-02-25 22:58:28 +08:00
|
|
|
|
2023-02-26 21:48:03 +08:00
|
|
|
CKManagerImplements::CKBaseManager* CreateCKManager(CKGUID guid);
|
|
|
|
CKManagerImplements::CKBaseManager* GetCKManager(CKGUID guid);
|
|
|
|
void DestroyCKManager(CKManagerImplements::CKBaseManager* mgr);
|
|
|
|
|
|
|
|
void GetUtf8String(std::string& native_name, std::string& u8_name);
|
|
|
|
void GetNativeString(std::string& u8_name, std::string& native_name);
|
2023-02-25 22:58:28 +08:00
|
|
|
|
|
|
|
void SetEncoding(CKSTRING encoding);
|
|
|
|
void SetTempPath(CKSTRING u8_temp);
|
|
|
|
|
|
|
|
FILE* OpenTempFile(CKSTRING u8_filename, bool is_read);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void RefetchEncodingToken(void);
|
|
|
|
|
2023-02-26 21:48:03 +08:00
|
|
|
std::string m_NameEncoding;
|
|
|
|
EncodingHelper::ENCODING_TOKEN m_NameEncodingToken;
|
|
|
|
std::filesystem::path m_TempFolder;
|
|
|
|
PrintCallback m_PrintCallback;
|
2023-02-25 22:58:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|