sl@0: /* sl@0: * Copyright (c) 1999 sl@0: * Silicon Graphics Computer Systems, Inc. sl@0: * sl@0: * Copyright (c) 1999 sl@0: * Boris Fomitchev sl@0: * sl@0: * This material is provided "as is", with absolutely no warranty expressed sl@0: * or implied. Any use is at your own risk. sl@0: * sl@0: * Permission to use or copy this software for any purpose is hereby granted sl@0: * without fee, provided the above notices are retained on all copies. sl@0: * Permission to modify the code and to distribute modified code is granted, sl@0: * provided the above notices are retained, and a notice that the code was sl@0: * modified is included with the above copyright notice. sl@0: * sl@0: */ sl@0: sl@0: #ifndef LOCALE_IMPL_H sl@0: #define LOCALE_IMPL_H sl@0: sl@0: #include // C locale header file. sl@0: #include sl@0: #include sl@0: #include sl@0: #include "c_locale.h" sl@0: sl@0: _STLP_BEGIN_NAMESPACE sl@0: sl@0: #if defined (_STLP_USE_TEMPLATE_EXPORT) sl@0: //Export of _Locale_impl facets container: sl@0: # if !defined (_STLP_USE_PTR_SPECIALIZATIONS) sl@0: //If we are using pointer specialization, vector will use sl@0: //the already exported vector implementation. sl@0: _STLP_EXPORT_TEMPLATE_CLASS allocator; sl@0: sl@0: _STLP_MOVE_TO_PRIV_NAMESPACE sl@0: sl@0: _STLP_EXPORT_TEMPLATE_CLASS _STLP_alloc_proxy >; sl@0: _STLP_EXPORT_TEMPLATE_CLASS _Vector_base >; sl@0: sl@0: _STLP_MOVE_TO_STD_NAMESPACE sl@0: # endif sl@0: # if defined (_STLP_DEBUG) sl@0: _STLP_MOVE_TO_PRIV_NAMESPACE sl@0: # define _STLP_NON_DBG_VECTOR _STLP_NON_DBG_NAME(vector) sl@0: _STLP_EXPORT_TEMPLATE_CLASS __construct_checker<_STLP_NON_DBG_VECTOR > >; sl@0: _STLP_EXPORT_TEMPLATE_CLASS _STLP_NON_DBG_VECTOR >; sl@0: # undef _STLP_NON_DBG_VECTOR sl@0: _STLP_MOVE_TO_STD_NAMESPACE sl@0: # endif sl@0: sl@0: _STLP_EXPORT_TEMPLATE_CLASS vector >; sl@0: #endif sl@0: sl@0: //---------------------------------------------------------------------- sl@0: // Class _Locale_impl sl@0: // This is the base class which implements access only and is supposed to sl@0: // be used for classic locale only sl@0: class _STLP_CLASS_DECLSPEC _Locale_impl : public _Refcount_Base { sl@0: public: sl@0: _Locale_impl(const char* s); sl@0: _Locale_impl(const _Locale_impl&); sl@0: _Locale_impl(size_t n, const char* s); sl@0: sl@0: private: sl@0: ~_Locale_impl(); sl@0: sl@0: public: sl@0: size_t size() const { return facets_vec.size(); } sl@0: sl@0: basic_string, allocator > name; sl@0: sl@0: static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_bad_cast(); sl@0: sl@0: private: sl@0: void operator=(const _Locale_impl&); sl@0: sl@0: public: sl@0: class _STLP_CLASS_DECLSPEC Init { sl@0: public: sl@0: Init(); sl@0: ~Init(); sl@0: private: sl@0: _Refcount_Base& _M_count() const; sl@0: }; sl@0: sl@0: static void _STLP_CALL _S_initialize(); sl@0: static void _STLP_CALL _S_uninitialize(); sl@0: sl@0: static void make_classic_locale(); sl@0: static void free_classic_locale(); sl@0: sl@0: friend class Init; sl@0: sl@0: public: // _Locale sl@0: // void remove(size_t index); sl@0: locale::facet* insert(locale::facet*, size_t index); sl@0: void insert(_Locale_impl* from, const locale::id& n); sl@0: sl@0: // Helper functions for byname construction of locales. sl@0: _Locale_name_hint* insert_ctype_facets(const char* name, _Locale_name_hint* hint); sl@0: _Locale_name_hint* insert_numeric_facets(const char* name, _Locale_name_hint* hint); sl@0: _Locale_name_hint* insert_time_facets(const char* name, _Locale_name_hint* hint); sl@0: _Locale_name_hint* insert_collate_facets(const char* name, _Locale_name_hint* hint); sl@0: _Locale_name_hint* insert_monetary_facets(const char* name, _Locale_name_hint* hint); sl@0: _Locale_name_hint* insert_messages_facets(const char* name, _Locale_name_hint* hint); sl@0: sl@0: bool operator != (const locale& __loc) const { return __loc._M_impl != this; } sl@0: sl@0: private: sl@0: vector facets_vec; sl@0: sl@0: private: sl@0: friend _Locale_impl * _STLP_CALL _copy_Locale_impl( _Locale_impl * ); sl@0: friend _STLP_IMPORT_DECLSPEC _Locale_impl * _STLP_CALL _copy_Nameless_Locale_impl( _Locale_impl * ); sl@0: friend void _STLP_CALL _release_Locale_impl( _Locale_impl *& loc ); sl@0: #if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) sl@0: friend class _STLP_NO_MEM_T_NAME(loc); sl@0: #else sl@0: friend class locale; sl@0: #endif sl@0: }; sl@0: sl@0: void _STLP_CALL _release_Locale_impl( _Locale_impl *& loc ); sl@0: _Locale_impl * _STLP_CALL _copy_Locale_impl( _Locale_impl *loc ); sl@0: sl@0: _STLP_END_NAMESPACE sl@0: sl@0: #endif sl@0: sl@0: // Local Variables: sl@0: // mode:C++ sl@0: // End: