7 #ifndef BOOST_LOCALE_ENCODING_HPP_INCLUDED 8 #define BOOST_LOCALE_ENCODING_HPP_INCLUDED 10 #include <boost/locale/config.hpp> 11 #include <boost/locale/info.hpp> 12 #include <boost/locale/encoding_errors.hpp> 13 #include <boost/locale/encoding_utf.hpp> 16 # pragma warning(push) 17 # pragma warning(disable : 4275 4251 4231 4660) 35 template<
typename CharType>
41 template<
typename CharType>
49 template<
typename CharType>
52 return to_utf<CharType>(begin,end,std::use_facet<info>(loc).encoding(),how);
60 template<
typename CharType>
63 return from_utf(begin,end,std::use_facet<info>(loc).encoding(),how);
70 template<
typename CharType>
73 return to_utf<CharType>(text.c_str(),text.c_str()+text.size(),charset,how);
79 template<
typename CharType>
82 return from_utf(text.c_str(),text.c_str()+text.size(),charset,how);
88 template<
typename CharType>
91 char const *text_end = text;
94 return to_utf<CharType>(text,text_end,charset,how);
100 template<
typename CharType>
103 CharType
const *text_end = text;
106 return from_utf(text,text_end,charset,how);
114 template<
typename CharType>
117 return to_utf<CharType>(text.c_str(),text.c_str()+text.size(),loc,how);
125 template<
typename CharType>
128 return from_utf(text.c_str(),text.c_str()+text.size(),loc,how);
136 template<
typename CharType>
139 char const *text_end = text;
142 return to_utf<CharType>(text,text_end,loc,how);
150 template<
typename CharType>
153 CharType
const *text_end = text;
156 return from_utf(text,text_end,loc,how);
165 std::string
between(
char const *begin,
167 std::string
const &to_encoding,
168 std::string
const &from_encoding,
177 std::string
const &to_encoding,
178 std::string
const &from_encoding,
181 char const *end=text;
192 std::string
const &to_encoding,
193 std::string
const &from_encoding,
202 BOOST_LOCALE_DECL std::basic_string<char>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
205 BOOST_LOCALE_DECL std::string
from_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
208 BOOST_LOCALE_DECL std::basic_string<wchar_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
211 BOOST_LOCALE_DECL std::string
from_utf(
wchar_t const *begin,
wchar_t const *end,std::string
const &charset,
method_type how);
213 #ifdef BOOST_LOCALE_ENABLE_CHAR16_T 215 BOOST_LOCALE_DECL std::basic_string<char16_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
218 BOOST_LOCALE_DECL std::string
from_utf(char16_t
const *begin,char16_t
const *end,std::string
const &charset,
method_type how);
221 #ifdef BOOST_LOCALE_ENABLE_CHAR32_T 223 BOOST_LOCALE_DECL std::basic_string<char32_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
226 BOOST_LOCALE_DECL std::string
from_utf(char32_t
const *begin,char32_t
const *end,std::string
const &charset,
method_type how);
std::string from_utf(CharType const *begin, CharType const *end, std::string const &charset, method_type how=default_method)
std::basic_string< CharType > to_utf(char const *begin, char const *end, std::string const &charset, method_type how=default_method)
Default method - skip.
Definition: encoding_errors.hpp:55
std::string between(char const *begin, char const *end, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
method_type
Definition: encoding_errors.hpp:52