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