generator.hpp
//
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_LOCALE_GENERATOR_HPP
#define BOOST_LOCALE_GENERATOR_HPP
#include <boost/locale/config.hpp>
#include <boost/cstdint.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
#include <string>
#include <locale>
#include <memory>
namespace boost {
template<typename Type>
class shared_ptr;
namespace locale {
class localization_backend;
class localization_backend_manager;
static const uint32_t nochar_facet = 0;
static const uint32_t char_facet = 1 << 0;
static const uint32_t wchar_t_facet = 1 << 1;
static const uint32_t char16_t_facet = 1 << 2;
static const uint32_t char32_t_facet = 1 << 3;
static const uint32_t character_first_facet = char_facet;
static const uint32_t character_last_facet = char32_t_facet;
static const uint32_t all_characters = 0xFFFF;
typedef uint32_t character_facet_type;
static const uint32_t convert_facet = 1 << 0;
static const uint32_t collation_facet = 1 << 1;
static const uint32_t formatting_facet= 1 << 2;
static const uint32_t parsing_facet = 1 << 3;
static const uint32_t message_facet = 1 << 4;
static const uint32_t codepage_facet = 1 << 5;
static const uint32_t boundary_facet = 1 << 6;
static const uint32_t per_character_facet_first = convert_facet;
static const uint32_t per_character_facet_last = boundary_facet;
static const uint32_t calendar_facet = 1 << 16;
static const uint32_t information_facet = 1 << 17;
static const uint32_t non_character_facet_first = calendar_facet;
static const uint32_t non_character_facet_last = information_facet;
static const uint32_t all_categories = 0xFFFFFFFFu;
typedef uint32_t locale_category_type;
class BOOST_LOCALE_DECL generator {
public:
generator();
generator(localization_backend_manager const &);
~generator();
void categories(locale_category_type cats);
locale_category_type categories() const;
void characters(character_facet_type chars);
character_facet_type characters() const;
void add_messages_domain(std::string const &domain);
void set_default_messages_domain(std::string const &domain);
void clear_domains();
void add_messages_path(std::string const &path);
void clear_paths();
void clear_cache();
void locale_cache_enabled(bool on);
bool locale_cache_enabled() const;
bool use_ansi_encoding() const;
void use_ansi_encoding(bool enc);
std::locale generate(std::string const &id) const;
std::locale generate(std::locale const &base,std::string const &id) const;
std::locale operator()(std::string const &id) const
{
return generate(id);
}
void set_option(std::string const &name,std::string const &value);
void clear_options();
private:
void set_all_options(shared_ptr<localization_backend> backend,std::string const &id) const;
generator(generator const &);
void operator=(generator const &);
struct data;
std::auto_ptr<data> d;
};
}
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
boost::locale::boundary_facet
static const uint32_t boundary_facet
Generate boundary analysis facet.
Definition: generator.hpp:51
boost::locale::non_character_facet_first
static const uint32_t non_character_facet_first
First character independent facet.
Definition: generator.hpp:59
boost::locale::calendar_facet
the facet that generates calendar for specific locale
Definition: date_time_facet.hpp:234
boost::locale::localization_backend_manager
Localization backend manager is a class that holds various backend and allows creation of their combi...
Definition: localization_backend.hpp:84
boost::locale::parsing_facet
static const uint32_t parsing_facet
Generate numbers, currency, date-time formatting facets.
Definition: generator.hpp:48
boost::locale::nochar_facet
static const uint32_t nochar_facet
Unspecified character category for character independent facets.
Definition: generator.hpp:33
boost::locale::character_facet_type
uint32_t character_facet_type
type that specifies the character type that locales can be generated for
Definition: generator.hpp:43
boost::locale::formatting_facet
static const uint32_t formatting_facet
Generate numbers, currency, date-time formatting facets.
Definition: generator.hpp:47
boost::locale::convert_facet
static const uint32_t convert_facet
Generate conversion facets.
Definition: generator.hpp:45
boost::locale::generator::operator()
std::locale operator()(std::string const &id) const
Definition: generator.hpp:200
boost::locale::per_character_facet_last
static const uint32_t per_character_facet_last
Last facet specific for character.
Definition: generator.hpp:54
boost::shared_ptr
Definition: generator.hpp:23
boost::locale::calendar_facet
static const uint32_t calendar_facet
Generate boundary analysis facet.
Definition: generator.hpp:56
boost::locale::message_facet
static const uint32_t message_facet
Generate message facets.
Definition: generator.hpp:49
boost::locale::codepage_facet
static const uint32_t codepage_facet
Generate character set conversion facets (derived from std::codecvt)
Definition: generator.hpp:50
boost::locale::per_character_facet_first
static const uint32_t per_character_facet_first
First facet specific for character.
Definition: generator.hpp:53
boost::locale::character_last_facet
static const uint32_t character_last_facet
Last facet specific for character type.
Definition: generator.hpp:40
boost::locale::character_first_facet
static const uint32_t character_first_facet
First facet specific for character type.
Definition: generator.hpp:39
boost::locale::collation_facet
static const uint32_t collation_facet
Generate collation facets.
Definition: generator.hpp:46
boost::locale::non_character_facet_last
static const uint32_t non_character_facet_last
Last character independent facet.
Definition: generator.hpp:60
boost::locale::char16_t_facet
static const uint32_t char16_t_facet
C++0x char16_t facets.
Definition: generator.hpp:36
boost::locale::as::domain
unspecified_type domain(std::string const &id)
Definition: message.hpp:789
boost::locale::char32_t_facet
static const uint32_t char32_t_facet
C++0x char32_t facets.
Definition: generator.hpp:37
boost::locale::locale_category_type
uint32_t locale_category_type
a type used for more fine grained generation of facets
Definition: generator.hpp:65
boost::locale::information_facet
static const uint32_t information_facet
Generate general locale information facet.
Definition: generator.hpp:57
boost::locale::generator
the major class used for locale generation
Definition: generator.hpp:74
boost::locale::char_facet
static const uint32_t char_facet
8-bit character facets
Definition: generator.hpp:34
boost::locale::all_categories
static const uint32_t all_categories
Generate all of them.
Definition: generator.hpp:63
boost::locale::wchar_t_facet
static const uint32_t wchar_t_facet
wide character facets
Definition: generator.hpp:35
boost::locale::all_characters
static const uint32_t all_characters
Special mask – generate all.
Definition: generator.hpp:41
- © Copyright 2009-2012 Artyom Beilis, Distributed under the Boost Software License, Version 1.0.