Boost.Locale
boost::locale::localization_backend_manager Class Reference

Localization backend manager is a class that holds various backend and allows creation of their combination or selection. More...

#include <boost/locale/localization_backend.hpp>

Public Member Functions

 localization_backend_manager ()
 New empty localization_backend_manager.
 
 localization_backend_manager (const localization_backend_manager &)
 Copy localization_backend_manager.
 
localization_backend_manageroperator= (const localization_backend_manager &)
 Assign localization_backend_manager.
 
 localization_backend_manager (localization_backend_manager &&) noexcept
 Move construct localization_backend_manager.
 
localization_backend_manageroperator= (localization_backend_manager &&) noexcept
 Move assign localization_backend_manager.
 
 ~localization_backend_manager ()
 Destructor.
 
std::unique_ptr< localization_backendcreate () const
 Create new localization backend according to current settings. Ownership is passed to caller.
 
std::unique_ptr< localization_backendget () const
 
std::unique_ptr< localization_backendget_unique_ptr () const
 
void add_backend (const std::string &name, std::unique_ptr< localization_backend > backend)
 
void adopt_backend (const std::string &name, localization_backend *backend)
 
void remove_all_backends ()
 Clear backend.
 
std::vector< std::string > get_all_backends () const
 Get list of all available backends.
 
void select (const std::string &backend_name, category_t category=all_categories)
 

Static Public Member Functions

static localization_backend_manager global (const localization_backend_manager &)
 
static localization_backend_manager global ()
 

Detailed Description

Localization backend manager is a class that holds various backend and allows creation of their combination or selection.

Member Function Documentation

◆ add_backend()

void boost::locale::localization_backend_manager::add_backend ( const std::string &  name,
std::unique_ptr< localization_backend backend 
)

Add new backend to the manager, each backend should be uniquely defined by its name.

This library provides: "icu", "posix", "winapi" and "std" backends.

◆ global() [1/2]

static localization_backend_manager boost::locale::localization_backend_manager::global ( )
static

Get global backend manager

This function is thread safe

Examples
conversions.cpp, and wconversions.cpp.

◆ global() [2/2]

static localization_backend_manager boost::locale::localization_backend_manager::global ( const localization_backend_manager )
static

Set new global backend manager, the old one is returned.

This function is thread safe

◆ select()

void boost::locale::localization_backend_manager::select ( const std::string &  backend_name,
category_t  category = all_categories 
)

Select specific backend by name for a category category. It allows combining different backends for user preferences.


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