#pragma once #include #include #include namespace yycc::encoding::stlcvt { /// @brief Possible convertion error occurs in this module. struct ConvError {}; /// @brief The result type of this module. template using ConvResult = std::expected; /** * @brief UTF8 -> UTF16 * @param src * @return */ ConvResult to_utf16(const std::u8string_view& src); /** * @brief UTF16 -> UTF8 * @param src * @return */ ConvResult to_utf8(const std::u16string_view& src); /** * @brief UTF8 -> UTF32 * @param src * @return */ ConvResult to_utf32(const std::u8string_view& src); /** * @brief UTF32 -> UTF8 * @param src * @return */ ConvResult utf8(const std::u32string_view& src); }