7 #ifndef BOOST_LOCALE_UTIL_HPP 8 #define BOOST_LOCALE_UTIL_HPP 10 #include <boost/locale/generator.hpp> 11 #include <boost/locale/utf.hpp> 12 #include <boost/assert.hpp> 13 #include <boost/cstdint.hpp> 18 namespace boost {
namespace locale {
53 std::locale
create_info(
const std::locale& in,
const std::string& name);
114 virtual uint32_t
to_unicode(
const char*& begin,
const char* end)
118 unsigned char cp = *begin;
136 virtual uint32_t
from_unicode(uint32_t u,
char* begin,
const char* end)
142 *begin = static_cast<char>(u);
151 BOOST_DEPRECATED(
"This function is deprecated, use 'create_utf8_converter()'")
152 inline std::unique_ptr<base_converter> create_utf8_converter_unique_ptr()
164 BOOST_DEPRECATED(
"This function is deprecated, use 'create_simple_converter()'")
165 inline std::unique_ptr<base_converter> create_simple_converter_unique_ptr(const std::
string& encoding)
183 BOOST_DEPRECATED(
"This function is deprecated, use 'create_codecvt()'")
184 inline std::locale create_codecvt_from_pointer(const std::locale& in, base_converter* cvt,
char_facet_t type)
186 return create_codecvt(in, std::unique_ptr<base_converter>(cvt), type);
std::locale create_codecvt(const std::locale &in, std::unique_ptr< base_converter > cvt, char_facet_t type)
virtual base_converter * clone() const
Create a polymorphic copy of this object, usually called only if is_thread_safe() return false.
Definition: util.hpp:94
virtual uint32_t from_unicode(uint32_t u, char *begin, const char *end)
Definition: util.hpp:136
char_facet_t
Definition: generator.hpp:34
virtual int max_len() const
Definition: util.hpp:82
std::locale create_info(const std::locale &in, const std::string &name)
Installs information facet to locale in based on locale name name.
base_converter * create_utf8_converter_new_ptr()
std::locale create_utf8_codecvt(const std::locale &in, char_facet_t type)
This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point.
Definition: util.hpp:67
std::string get_system_locale(bool use_utf8_on_windows=false)
Return default system locale name in POSIX format.
std::unique_ptr< base_converter > create_utf8_converter()
std::locale create_simple_codecvt(const std::locale &in, const std::string &encoding, char_facet_t type)
constexpr code_point illegal
Special constant that defines illegal code point.
Definition: utf.hpp:22
base_converter * create_simple_converter_new_ptr(const std::string &encoding)
virtual uint32_t to_unicode(const char *&begin, const char *end)
Definition: util.hpp:114
std::unique_ptr< base_converter > create_simple_converter(const std::string &encoding)
virtual bool is_thread_safe() const
Definition: util.hpp:91
constexpr code_point incomplete
Special constant that defines incomplete code point.
Definition: utf.hpp:24