CppCMS
Public Member Functions | List of all members
booster::locale::localization_backend Class Referenceabstract

this class represents a localization backend that can be used for localizing your application. More...

#include <booster/booster/locale/localization_backend.h>

Public Member Functions

virtual localization_backendclone () 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
 

Detailed Description

this class represents a localization backend that can be used for localizing your application.

Backends are usually registered inside the localization backends manager and allow transparent support of different backends, so a user can switch the backend by simply linking the application to the correct one.

Backends may support different tuning options, but these are the default options available to the user for all of them

  1. locale - the name of the locale in POSIX format like en_US.UTF-8
  2. use_ansi_encoding - select system locale using ANSI codepages rather then UTF-8 under Windows by default
  3. message_path - path to the location of message catalogs (vector of strings)
  4. message_application - the name of applications that use message catalogs (vector of strings)

Each backend can be installed with a different default priotiry so when you work with two different backends, you can specify priotiry so this backend will be chosen according to their priority.

Member Function Documentation

virtual void booster::locale::localization_backend::clear_options ( )
pure virtual

Clear all options

virtual localization_backend* booster::locale::localization_backend::clone ( ) const
pure virtual

Make a polymorphic copy of the backend

virtual std::locale booster::locale::localization_backend::install ( std::locale const &  base,
locale_category_type  category,
character_facet_type  type = nochar_facet 
)
pure virtual

Create a facet for category category and character type type

virtual void booster::locale::localization_backend::set_option ( std::string const &  name,
std::string const &  value 
)
pure virtual

Set option for backend, for example "locale" or "encoding"


The documentation for this class was generated from the following file: