localization_backend.h
//
// 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 BOOSTER_LOCALE_LOCALIZATION_BACKEND_HPP
#define BOOSTER_LOCALE_LOCALIZATION_BACKEND_HPP
#include <booster/config.h>
#include <booster/locale/generator.h>
#ifdef BOOSTER_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
#include <string>
#include <locale>
#include <vector>
#include <memory>
namespace booster {
namespace locale {
class localization_backend {
localization_backend(localization_backend const &);
void operator=(localization_backend const &);
public:
localization_backend()
{
}
virtual ~localization_backend()
{
}
virtual localization_backend *clone() const = 0;
virtual void set_option(std::string const &name,std::string const &value) = 0;
virtual void clear_options() = 0;
virtual std::locale install(std::locale const &base,locale_category_type category,character_facet_type type = nochar_facet) = 0;
}; // localization_backend
class BOOSTER_API localization_backend_manager {
public:
localization_backend_manager();
localization_backend_manager(localization_backend_manager const &);
localization_backend_manager const &operator=(localization_backend_manager const &);
~localization_backend_manager();
std::auto_ptr<localization_backend> get() const;
void add_backend(std::string const &name,std::auto_ptr<localization_backend> backend);
void remove_all_backends();
std::vector<std::string> get_all_backends() const;
void select(std::string const &backend_name,locale_category_type category = all_categories);
static localization_backend_manager global(localization_backend_manager const &);
static localization_backend_manager global();
private:
class impl;
std::auto_ptr<impl> pimpl_;
};
} // locale
} // boost
#ifdef BOOSTER_MSVC
#pragma warning(pop)
#endif
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
booster::locale::localization_backend::install
virtual std::locale install(std::locale const &base, locale_category_type category, character_facet_type type=nochar_facet)=0
booster::locale::character_facet_type
uint32_t character_facet_type
type that specifies the character type that locales can be generated for
Definition: generator.h:43
booster::locale::locale_category_type
uint32_t locale_category_type
a type used for more fine grained generation of facets
Definition: generator.h:65
booster::locale::localization_backend::clone
virtual localization_backend * clone() const =0
booster::locale::localization_backend::set_option
virtual void set_option(std::string const &name, std::string const &value)=0
booster::locale::localization_backend::clear_options
virtual void clear_options()=0
booster::locale::localization_backend_manager
Localization backend manager is a class that holds various backend and allows creation of their combi...
Definition: localization_backend.h:84
booster::locale::localization_backend
this class represents a localization backend that can be used for localizing your application...
Definition: localization_backend.h:43