7#ifndef BOOST_LOCALE_GENERATOR_HPP
8#define BOOST_LOCALE_GENERATOR_HPP
10#include <boost/locale/hold_ptr.hpp>
18# pragma warning(disable : 4275 4251 4231 4660)
28 class localization_backend;
29 class localization_backend_manager;
41#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
44#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
48 typedef BOOST_DEPRECATED(
"Use char_facet_t")
char_facet_t character_facet_type;
54#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
56#elif defined BOOST_LOCALE_ENABLE_CHAR16_T
58#elif defined __cpp_char8_t
59 char_facet_t::char8_f;
80 typedef BOOST_DEPRECATED(
"Use category_t")
category_t locale_category_type;
186 std::locale
generate(
const std::locale& base,
const std::string&
id)
const;
188 std::locale
operator()(
const std::string&
id)
const {
return generate(
id); }
202 return char_facet_t(
static_cast<uint32_t
>(lhs) |
static_cast<uint32_t
>(rhs));
206 return char_facet_t(
static_cast<uint32_t
>(lhs) ^
static_cast<uint32_t
>(rhs));
210 return (
static_cast<uint32_t
>(lhs) &
static_cast<uint32_t
>(rhs)) != 0u;
215 return v =
char_facet_t(
static_cast<uint32_t
>(v) ?
static_cast<uint32_t
>(v) << 1 : 1);
220 return category_t(
static_cast<uint32_t
>(lhs) |
static_cast<uint32_t
>(rhs));
224 return category_t(
static_cast<uint32_t
>(lhs) ^
static_cast<uint32_t
>(rhs));
228 return (
static_cast<uint32_t
>(lhs) &
static_cast<uint32_t
>(rhs)) != 0u;
233 return v =
category_t(
static_cast<uint32_t
>(v) << 1);
This class represents a message that can be converted to a specific locale message.
Definition: message.hpp:142
this class provides an access to general calendar information.
Definition: date_time.hpp:466
the major class used for locale generation
Definition: generator.hpp:101
generator(const localization_backend_manager &)
Create new generator using specific localization_backend_manager.
char_facet_t characters() const
Get the characters type for which the facets should be generated, default all supported.
std::locale generate(const std::locale &base, const std::string &id) const
generator()
Create new generator using global localization_backend_manager.
void add_messages_path(const std::string &path)
void clear_cache()
Remove all cached locales.
std::locale operator()(const std::string &id) const
Shortcut to generate(id)
Definition: generator.hpp:188
bool locale_cache_enabled() const
Get locale cache option.
void set_default_messages_domain(const std::string &domain)
void locale_cache_enabled(bool on)
Turn locale caching ON.
void categories(category_t cats)
Set types of facets that should be generated, default all.
void use_ansi_encoding(bool enc)
void clear_domains()
Remove all added domains from the list.
void clear_paths()
Remove all added paths.
void add_messages_domain(const std::string &domain)
category_t categories() const
Get types of facets that should be generated, default all.
bool use_ansi_encoding() const
Check if by default ANSI encoding is selected or UTF-8 onces. The default is false.
std::locale generate(const std::string &id) const
Generate a locale with id id.
void characters(char_facet_t chars)
Set the characters type for which the facets should be generated, default all supported.
a smart pointer similar to std::unique_ptr but the underlying object has the same constness as the po...
Definition: hold_ptr.hpp:17
Localization backend manager is a class that holds various backend and allows creation of their combi...
Definition: localization_backend.hpp:65
this class represents a localization backend that can be used for localizing your application.
Definition: localization_backend.hpp:40
constexpr char_facet_t character_facet_last
Last facet specific for character type.
Definition: generator.hpp:53
constexpr char_facet_t all_characters
Special mask – generate all.
Definition: generator.hpp:64
constexpr category_t category_last
Last category facet.
Definition: generator.hpp:93
constexpr category_t per_character_facet_last
Last facet specific for character.
Definition: generator.hpp:85
char_facet_t
Definition: generator.hpp:34
@ nochar
Unspecified character category for character independent facets.
@ char16_f
C++11 char16_t facets.
@ char_f
8-bit character facets
@ char32_f
C++11 char32_t facets.
@ wchar_f
wide character facets
constexpr char_facet_t character_facet_first
First facet specific for character type.
Definition: generator.hpp:51
category_t
Definition: generator.hpp:69
@ codepage
Generate character set conversion facets (derived from std::codecvt)
@ convert
Generate conversion facets.
@ boundary
Generate boundary analysis facet.
@ information
Generate general locale information facet.
@ collation
Generate collation facets.
@ parsing
Generate numbers, currency, date-time formatting facets.
@ formatting
Generate numbers, currency, date-time formatting facets.
constexpr category_t non_character_facet_first
First character independent facet.
Definition: generator.hpp:87
constexpr category_t all_categories
Generate all of them.
Definition: generator.hpp:95
constexpr category_t category_first
First category facet.
Definition: generator.hpp:91
constexpr category_t non_character_facet_last
Last character independent facet.
Definition: generator.hpp:89
constexpr category_t per_character_facet_first
First facet specific for character.
Definition: generator.hpp:83