8 #ifndef BOOSTER_LOCALE_ENCODING_UTF_H_INCLUDED 9 #define BOOSTER_LOCALE_ENCODING_UTF_H_INCLUDED 11 #include <booster/locale/utf.h> 12 #include <booster/locale/encoding_errors.h> 15 # pragma warning(push) 16 # pragma warning(disable : 4275 4251 4231 4660) 32 template<
typename CharOut,
typename CharIn>
33 std::basic_string<CharOut>
36 std::basic_string<CharOut> result;
37 result.reserve(end-begin);
38 typedef std::back_insert_iterator<std::basic_string<CharOut> > inserter_type;
39 inserter_type inserter(result);
57 template<
typename CharOut,
typename CharIn>
58 std::basic_string<CharOut>
61 CharIn
const *end = str;
64 return utf_to_utf<CharOut,CharIn>(str,end,how);
71 template<
typename CharOut,
typename CharIn>
72 std::basic_string<CharOut>
75 return utf_to_utf<CharOut,CharIn>(str.c_str(),str.c_str()+str.size(),how);
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition: utf.h:34
Default method - skip.
Definition: encoding_errors.h:57
std::basic_string< CharOut > utf_to_utf(CharIn const *begin, CharIn const *end, method_type how=default_method)
Definition: encoding_utf.h:34
static const code_point incomplete
Special constant that defines incomplete code point.
Definition: utf.h:44
The excepton that is thrown in case of conversion error.
Definition: encoding_errors.h:31
static const code_point illegal
Special constant that defines illegal code point.
Definition: utf.h:39
This is the main namespace that encloses all localization classes.
Definition: locale_fwd.h:14
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
Stop conversion and throw conversion_error.
Definition: encoding_errors.h:56