fully remove dassault garbage code

This commit is contained in:
2023-02-25 22:58:28 +08:00
parent d32ed302d1
commit bf7c669ce6
15 changed files with 505 additions and 147 deletions

View File

@ -2,6 +2,7 @@
#include "VTUtils.hpp"
#include <string>
#include <filesystem>
#if defined(LIBCMO_OS_WIN32)
#include <Windows.h>
@ -25,6 +26,9 @@ namespace LibCmo {
bool CharToWchar(const char* src, std::wstring& dest, UINT codepage);
bool CharToWchar(std::string& src, std::wstring& dest, UINT codepage);
bool CharToChar(const char* src, std::string& dest, UINT src_codepage, UINT dest_codepage);
bool CharToChar(std::string& src, std::string& dest, UINT src_codepage, UINT dest_codepage);
#else
#error NO IMPLEMENTATION FOR LINUX ENCODING!
#endif
@ -35,9 +39,31 @@ namespace LibCmo {
#if defined(LIBCMO_OS_WIN32)
void GetUtf8VirtoolsName(std::string& native_name, std::string& u8_name, const char* u8_encoding_spec);
/// <summary>
/// Token is the ticket for using encoding functions.
/// It should be created by "GenerateEncodingToken" and free by "DestroyEncodingToken".
/// </summary>
using ENCODING_TOKEN = UINT*;
extern const ENCODING_TOKEN ENCODING_TOKEN_DEFAULT;
ENCODING_TOKEN CreateEncodingToken(std::string& token_string);
void DestroyEncodingToken(ENCODING_TOKEN token);
void GetUtf8VirtoolsName(std::string& native_name, std::string& u8_name, ENCODING_TOKEN token);
void GetNativeVirtoolsName(std::string& u8_name, std::string& native_name, ENCODING_TOKEN token);
void SetStdPathFromU8Path(std::filesystem::path& stdpath, const char* u8_path);
FILE* OpenStdPathFile(std::filesystem::path& u8_filepath, bool is_read);
#else
/// <summary>
/// Token is the ticket for using encoding functions.
/// It should be created by "GenerateEncodingToken" and free by "DestroyEncodingToken".
/// </summary>
using ENCODING_TOKEN = char*;
extern const ENCODING_TOKEN ENCODING_TOKEN_DEFAULT;
#error NO IMPLEMENTATION FOR LINUX ENCODING!
#endif