8 #ifndef BOOSTER_LOCALE_ENCODING_H_INCLUDED 9 #define BOOSTER_LOCALE_ENCODING_H_INCLUDED 11 #include <booster/config.h> 13 # pragma warning(push) 14 # pragma warning(disable : 4275 4251 4231 4660) 16 #include <booster/locale/info.h> 17 #include <booster/locale/encoding_errors.h> 18 #include <booster/locale/encoding_utf.h> 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 BOOSTER_API std::basic_string<char>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
207 BOOSTER_API std::string
from_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
210 BOOSTER_API std::basic_string<wchar_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
213 BOOSTER_API std::string
from_utf(
wchar_t const *begin,
wchar_t const *end,std::string
const &charset,
method_type how);
215 #ifdef BOOSTER_HAS_CHAR16_T 217 BOOSTER_API std::basic_string<char16_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
220 BOOSTER_API std::string
from_utf(char16_t
const *begin,char16_t
const *end,std::string
const &charset,
method_type how);
223 #ifdef BOOSTER_HAS_CHAR32_T 225 BOOSTER_API std::basic_string<char32_t>
to_utf(
char const *begin,
char const *end,std::string
const &charset,
method_type how);
228 BOOSTER_API std::string
from_utf(char32_t
const *begin,char32_t
const *end,std::string
const &charset,
method_type how);
Default method - skip.
Definition: encoding_errors.h:57
BOOSTER_API std::string between(char const *begin, char const *end, std::string const &to_encoding, std::string const &from_encoding, 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)
This is the main namespace that encloses all localization classes.
Definition: locale_fwd.h:14
std::string from_utf(CharType const *begin, CharType const *end, std::string const &charset, method_type how=default_method)
method_type
Definition: encoding_errors.h:54
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23