8#ifndef BOOST_LOCALE_UTIL_HPP
9#define BOOST_LOCALE_UTIL_HPP
11#include <boost/locale/generator.hpp>
12#include <boost/locale/utf.hpp>
13#include <boost/assert.hpp>
19namespace boost {
namespace locale {
53 std::locale
create_info(
const std::locale& in,
const std::string& name);
118 unsigned char cp = *begin;
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()'")
186 return create_codecvt(in, std::unique_ptr<base_converter>(cvt), type);
189 BOOST_DEPRECATED(
"This function is deprecated, use 'create_utf8_converter()'")
190 BOOST_LOCALE_DECL base_converter* create_utf8_converter_new_ptr();
193 BOOST_LOCALE_DECL base_converter* create_simple_converter_new_ptr(const std::
string& encoding);
This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point.
Definition: util.hpp:67
virtual utf::len_or_error from_unicode(utf::code_point u, char *begin, const char *end)
Definition: util.hpp:136
virtual int max_len() const
Definition: util.hpp:82
virtual bool is_thread_safe() const
Definition: util.hpp:91
virtual utf::code_point to_unicode(const char *&begin, const char *end)
Definition: util.hpp:114
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
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition: utf.hpp:19
code_point len_or_error
Either a length/size or an error (illegal/incomplete)
Definition: utf.hpp:27
std::locale create_utf8_codecvt(const std::locale &in, char_facet_t type)
std::unique_ptr< base_converter > create_simple_converter(const std::string &encoding)
std::locale create_codecvt(const std::locale &in, std::unique_ptr< base_converter > cvt, char_facet_t type)
std::string get_system_locale(bool use_utf8_on_windows=false)
Return default system locale name in POSIX format.
std::locale create_info(const std::locale &in, const std::string &name)
Installs information facet to locale in based on locale name name.
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)
char_facet_t
Definition: generator.hpp:34