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;
38#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
41#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
45 typedef BOOST_DEPRECATED(
"Use char_facet_t")
char_facet_t character_facet_type;
51#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
53#elif defined BOOST_LOCALE_ENABLE_CHAR16_T
75 typedef BOOST_DEPRECATED(
"Use category_t")
category_t locale_category_type;
181 std::locale
generate(
const std::locale& base,
const std::string&
id)
const;
183 std::locale
operator()(
const std::string&
id)
const {
return generate(
id); }
197 return char_facet_t(
static_cast<uint32_t
>(lhs) |
static_cast<uint32_t
>(rhs));
201 return char_facet_t(
static_cast<uint32_t
>(lhs) ^
static_cast<uint32_t
>(rhs));
205 return (
static_cast<uint32_t
>(lhs) &
static_cast<uint32_t
>(rhs)) != 0u;
210 return v =
char_facet_t(
static_cast<uint32_t
>(v) ?
static_cast<uint32_t
>(v) << 1 : 1);
215 return category_t(
static_cast<uint32_t
>(lhs) |
static_cast<uint32_t
>(rhs));
219 return category_t(
static_cast<uint32_t
>(lhs) ^
static_cast<uint32_t
>(rhs));
223 return (
static_cast<uint32_t
>(lhs) &
static_cast<uint32_t
>(rhs)) != 0u;
228 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:469
the major class used for locale generation
Definition: generator.hpp:96
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:183
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:50
constexpr char_facet_t all_characters
Special mask – generate all.
Definition: generator.hpp:59
constexpr category_t category_last
Last category facet.
Definition: generator.hpp:88
constexpr category_t per_character_facet_last
Last facet specific for character.
Definition: generator.hpp:80
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:48
category_t
Definition: generator.hpp:64
@ 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:82
constexpr category_t all_categories
Generate all of them.
Definition: generator.hpp:90
constexpr category_t category_first
First category facet.
Definition: generator.hpp:86
constexpr category_t non_character_facet_last
Last character independent facet.
Definition: generator.hpp:84
constexpr category_t per_character_facet_first
First facet specific for character.
Definition: generator.hpp:78