fix: use new way to manage iconv token.

- use new way to manage iconv token, instead of std::unique_ptr which cause template error (no viable sizeof) in pycodec.
- fix the wrong name in pycodec.
- remove useless code.
This commit is contained in:
2025-08-12 19:40:23 +08:00
parent 9ce52e8d4b
commit 2576523dbb
3 changed files with 25 additions and 17 deletions

View File

@ -4,7 +4,6 @@
#include <string>
#include <string_view>
#include <expected>
#include <memory>
namespace yycc::encoding::iconv {
@ -25,14 +24,15 @@ namespace yycc::encoding::iconv {
public:
Token(const CodeName& from_code, const CodeName& to_code);
~Token();
Token(Token&& rhs) noexcept;
Token& operator=(Token&& rhs) noexcept;
YYCC_DELETE_COPY(Token)
YYCC_DEFAULT_MOVE(Token)
bool is_valid() const;
PrivToken* get_inner() const;
private:
std::unique_ptr<PrivToken> inner;
PrivToken* inner;
};
/// @brief The possible error occurs in this module.