1
0

refactor: continue refactor to make the project can be built

This commit is contained in:
2025-07-31 22:25:14 +08:00
parent 5372af79f8
commit ce2b411b0b
30 changed files with 791 additions and 943 deletions

View File

@@ -1,8 +1,6 @@
#pragma once
#include "../macro/os_detector.hpp"
#if defined(YYCC_OS_WINDOWS)
#include "../macro/stl_detector.hpp"
#include <string>
#include <string_view>
#include <expected>
@@ -28,6 +26,8 @@ namespace yycc::encoding::windows {
template<typename T>
using ConvResult = std::expected<T, ConvError>;
#if defined(YYCC_OS_WINDOWS)
/**
* @brief WChar -> Char
* @param src
@@ -88,6 +88,12 @@ namespace yycc::encoding::windows {
*/
ConvResult<std::string> to_char(const std::u8string_view& src, CodePage code_page);
// YYC MARK:
// UTF convertion only works on Microsoft STL.
// See implementation for more details
#if defined(YYCC_STL_MSSTL)
/**
* @brief UTF8 -> UTF16
* @param src
@@ -116,6 +122,8 @@ namespace yycc::encoding::windows {
*/
ConvResult<std::u8string> to_utf8(const std::u32string_view& src);
} // namespace yycc::encoding::windows
#endif
#endif
} // namespace yycc::encoding::windows