refactor: use new layout for YYCC

This commit is contained in:
2025-08-12 16:32:59 +08:00
parent cfbc3c68e0
commit 7785773196
7 changed files with 20 additions and 6 deletions

View File

@ -18,7 +18,8 @@ PRIVATE
yycc/encoding/stl.cpp
yycc/encoding/windows.cpp
yycc/encoding/iconv.cpp
#yycc/encoding/pycodec.cpp
yycc/carton/pycodec.cpp
)
target_sources(YYCCommonplace
PUBLIC
@ -56,7 +57,8 @@ FILES
yycc/encoding/stl.hpp
yycc/encoding/windows.hpp
yycc/encoding/iconv.hpp
yycc/encoding/pycodec.hpp
yycc/carton/pycodec.hpp
)
# Setup header infomations
target_include_directories(YYCCommonplace

View File

@ -6,7 +6,7 @@
using namespace std::literals::string_view_literals;
namespace op = ::yycc::string::op;
namespace yycc::encoding::pycodec {
namespace yycc::carton::pycodec {
#pragma region Encoding Name

View File

@ -9,12 +9,12 @@
// Choose the backend of PyCodec module
#if defined(YYCC_FEAT_ICONV)
// We try Iconv first in any cases.
#include "iconv.hpp"
#include "../encoding/iconv.hpp"
#define YYCC_PYCODEC_ICONV_BACKEND
#define YYCC_PYCODEC_BACKEND_NS ::yycc::encoding::iconv
#elif defined(YYCC_OS_WINDOWS) && defined(YYCC_STL_MSSTL)
// If we can not use Iconv, we try to fallback to Windows implementation.
#include "windows.hpp"
#include "../encoding/windows.hpp"
#define YYCC_PYCODEC_WIN32_BACKEND
#define YYCC_PYCODEC_BACKEND_NS ::yycc::encoding::windows
#else
@ -22,7 +22,7 @@
#error "Can not find viable encoding convertion solution in current environment for PyCodec module."
#endif
namespace yycc::encoding::pycodec {
namespace yycc::carton::pycodec {
/// @brief The universal name of encoding.
using EncodingName = std::u8string_view;

View File

@ -21,6 +21,8 @@ PRIVATE
yycc/encoding/stl.cpp
yycc/encoding/windows.cpp
yycc/encoding/iconv.cpp
yycc/carton/pycodec.cpp
)
target_sources(YYCCTestbench
PRIVATE

View File

@ -0,0 +1,10 @@
#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/carton/pycodec.hpp>
#include "../../shared/literals.hpp"
#define ENC ::yycc::carton::pycodec
namespace yycctest::carton::pycodec {
}