summaryrefslogtreecommitdiff
path: root/boost/locale/localization_backend.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/locale/localization_backend.hpp')
-rw-r--r--boost/locale/localization_backend.hpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/boost/locale/localization_backend.hpp b/boost/locale/localization_backend.hpp
index ec8a1834fd..95bf3bd2d7 100644
--- a/boost/locale/localization_backend.hpp
+++ b/boost/locale/localization_backend.hpp
@@ -17,6 +17,7 @@
#include <locale>
#include <vector>
#include <memory>
+#include <boost/locale/hold_ptr.hpp>
namespace boost {
namespace locale {
@@ -101,6 +102,7 @@ namespace boost {
///
~localization_backend_manager();
+ #if !defined(BOOST_LOCALE_HIDE_AUTO_PTR) && !defined(BOOST_NO_AUTO_PTR)
///
/// Create new localization backend according to current settings.
///
@@ -112,6 +114,32 @@ namespace boost {
/// This library provides: "icu", "posix", "winapi" and "std" backends.
///
void add_backend(std::string const &name,std::auto_ptr<localization_backend> backend);
+ #endif
+
+ ///
+ /// Create new localization backend according to current settings. Ownership is passed to caller
+ ///
+ localization_backend *create() const;
+ ///
+ /// Add new backend to the manager, each backend should be uniquely defined by its name.
+ /// ownership on backend is transfered
+ ///
+ /// This library provides: "icu", "posix", "winapi" and "std" backends.
+ ///
+ void adopt_backend(std::string const &name,localization_backend *backend);
+ #ifndef BOOST_NO_CXX11_SMART_PTR
+ ///
+ /// Create new localization backend according to current settings.
+ ///
+ std::unique_ptr<localization_backend> get_unique_ptr() const;
+
+ ///
+ /// Add new backend to the manager, each backend should be uniquely defined by its name.
+ ///
+ /// This library provides: "icu", "posix", "winapi" and "std" backends.
+ ///
+ void add_backend(std::string const &name,std::unique_ptr<localization_backend> backend);
+ #endif
///
/// Clear backend
@@ -143,7 +171,7 @@ namespace boost {
static localization_backend_manager global();
private:
class impl;
- std::auto_ptr<impl> pimpl_;
+ hold_ptr<impl> pimpl_;
};
} // locale