refactor: use new layout for YYCC
This commit is contained in:
@ -18,7 +18,8 @@ PRIVATE
|
|||||||
yycc/encoding/stl.cpp
|
yycc/encoding/stl.cpp
|
||||||
yycc/encoding/windows.cpp
|
yycc/encoding/windows.cpp
|
||||||
yycc/encoding/iconv.cpp
|
yycc/encoding/iconv.cpp
|
||||||
#yycc/encoding/pycodec.cpp
|
|
||||||
|
yycc/carton/pycodec.cpp
|
||||||
)
|
)
|
||||||
target_sources(YYCCommonplace
|
target_sources(YYCCommonplace
|
||||||
PUBLIC
|
PUBLIC
|
||||||
@ -56,7 +57,8 @@ FILES
|
|||||||
yycc/encoding/stl.hpp
|
yycc/encoding/stl.hpp
|
||||||
yycc/encoding/windows.hpp
|
yycc/encoding/windows.hpp
|
||||||
yycc/encoding/iconv.hpp
|
yycc/encoding/iconv.hpp
|
||||||
yycc/encoding/pycodec.hpp
|
|
||||||
|
yycc/carton/pycodec.hpp
|
||||||
)
|
)
|
||||||
# Setup header infomations
|
# Setup header infomations
|
||||||
target_include_directories(YYCCommonplace
|
target_include_directories(YYCCommonplace
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
using namespace std::literals::string_view_literals;
|
using namespace std::literals::string_view_literals;
|
||||||
namespace op = ::yycc::string::op;
|
namespace op = ::yycc::string::op;
|
||||||
|
|
||||||
namespace yycc::encoding::pycodec {
|
namespace yycc::carton::pycodec {
|
||||||
|
|
||||||
#pragma region Encoding Name
|
#pragma region Encoding Name
|
||||||
|
|
@ -9,12 +9,12 @@
|
|||||||
// Choose the backend of PyCodec module
|
// Choose the backend of PyCodec module
|
||||||
#if defined(YYCC_FEAT_ICONV)
|
#if defined(YYCC_FEAT_ICONV)
|
||||||
// We try Iconv first in any cases.
|
// We try Iconv first in any cases.
|
||||||
#include "iconv.hpp"
|
#include "../encoding/iconv.hpp"
|
||||||
#define YYCC_PYCODEC_ICONV_BACKEND
|
#define YYCC_PYCODEC_ICONV_BACKEND
|
||||||
#define YYCC_PYCODEC_BACKEND_NS ::yycc::encoding::iconv
|
#define YYCC_PYCODEC_BACKEND_NS ::yycc::encoding::iconv
|
||||||
#elif defined(YYCC_OS_WINDOWS) && defined(YYCC_STL_MSSTL)
|
#elif defined(YYCC_OS_WINDOWS) && defined(YYCC_STL_MSSTL)
|
||||||
// If we can not use Iconv, we try to fallback to Windows implementation.
|
// 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_WIN32_BACKEND
|
||||||
#define YYCC_PYCODEC_BACKEND_NS ::yycc::encoding::windows
|
#define YYCC_PYCODEC_BACKEND_NS ::yycc::encoding::windows
|
||||||
#else
|
#else
|
||||||
@ -22,7 +22,7 @@
|
|||||||
#error "Can not find viable encoding convertion solution in current environment for PyCodec module."
|
#error "Can not find viable encoding convertion solution in current environment for PyCodec module."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace yycc::encoding::pycodec {
|
namespace yycc::carton::pycodec {
|
||||||
|
|
||||||
/// @brief The universal name of encoding.
|
/// @brief The universal name of encoding.
|
||||||
using EncodingName = std::u8string_view;
|
using EncodingName = std::u8string_view;
|
@ -21,6 +21,8 @@ PRIVATE
|
|||||||
yycc/encoding/stl.cpp
|
yycc/encoding/stl.cpp
|
||||||
yycc/encoding/windows.cpp
|
yycc/encoding/windows.cpp
|
||||||
yycc/encoding/iconv.cpp
|
yycc/encoding/iconv.cpp
|
||||||
|
|
||||||
|
yycc/carton/pycodec.cpp
|
||||||
)
|
)
|
||||||
target_sources(YYCCTestbench
|
target_sources(YYCCTestbench
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
10
testbench/yycc/carton/pycodec.cpp
Normal file
10
testbench/yycc/carton/pycodec.cpp
Normal 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 {
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user