8 #ifndef BOOST_LOCALE_ENCODING_HPP_INCLUDED
9 #define BOOST_LOCALE_ENCODING_HPP_INCLUDED
11 #include <boost/locale/config.hpp>
13 # pragma warning(push)
14 # pragma warning(disable : 4275 4251 4231 4660)
16 #include <boost/locale/info.hpp>
17 #include <boost/locale/encoding_errors.hpp>
18 #include <boost/locale/encoding_utf.hpp>
37 template<
typename CharType>
43 template<
typename CharType>
51 template<
typename CharType>
54 return to_utf<CharType>(begin,end,std::use_facet<info>(loc).encoding(),how);
62 template<
typename CharType>
65 return from_utf(begin,end,std::use_facet<info>(loc).encoding(),how);
72 template<
typename CharType>
75 return to_utf<CharType>(text.c_str(),text.c_str()+text.size(),charset,how);
81 template<
typename CharType>
84 return from_utf(text.c_str(),text.c_str()+text.size(),charset,how);
90 template<
typename CharType>
93 char const *text_end = text;
96 return to_utf<CharType>(text,text_end,charset,how);
102 template<
typename CharType>
105 CharType
const *text_end = text;
108 return from_utf(text,text_end,charset,how);
116 template<
typename CharType>
119 return to_utf<CharType>(text.c_str(),text.c_str()+text.size(),loc,how);
127 template<
typename CharType>
130 return from_utf(text.c_str(),text.c_str()+text.size(),loc,how);
138 template<
typename CharType>
141 char const *text_end = text;
144 return to_utf<CharType>(text,text_end,loc,how);
152 template<
typename CharType>
155 CharType
const *text_end = text;
158 return from_utf(text,text_end,loc,how);
167 std::string
between(
char const *begin,
169 std::string
const &to_encoding,
170 std::string
const &from_encoding,
179 std::string
const &to_encoding,
180 std::string
const &from_encoding,
183 char const *end=text;
194 std::string
const &to_encoding,
195 std::string
const &from_encoding,
204 BOOST_LOCALE_DECL std::basic_string<char>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
207 BOOST_LOCALE_DECL std::string
from_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
210 BOOST_LOCALE_DECL std::basic_string<wchar_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
213 BOOST_LOCALE_DECL std::string
from_utf(
wchar_t const *begin,
wchar_t const *end,std::string
const &charset,
method_type how);
215 #ifdef BOOST_LOCALE_ENABLE_CHAR16_T
217 BOOST_LOCALE_DECL std::basic_string<char16_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
220 BOOST_LOCALE_DECL std::string
from_utf(char16_t
const *begin,char16_t
const *end,std::string
const &charset,
method_type how);
223 #ifdef BOOST_LOCALE_ENABLE_CHAR32_T
225 BOOST_LOCALE_DECL std::basic_string<char32_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
228 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:57
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:54