First public contribution.
3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
22 #include <clocale> // C locale header file.
30 #if defined (_STLP_USE_TEMPLATE_EXPORT)
31 //Export of _Locale_impl facets container:
32 # if !defined (_STLP_USE_PTR_SPECIALIZATIONS)
33 //If we are using pointer specialization, vector<locale::facet*> will use
34 //the already exported vector<void*> implementation.
35 _STLP_EXPORT_TEMPLATE_CLASS allocator<locale::facet*>;
37 _STLP_MOVE_TO_PRIV_NAMESPACE
39 _STLP_EXPORT_TEMPLATE_CLASS _STLP_alloc_proxy<locale::facet**, locale::facet*, allocator<locale::facet*> >;
40 _STLP_EXPORT_TEMPLATE_CLASS _Vector_base<locale::facet*, allocator<locale::facet*> >;
42 _STLP_MOVE_TO_STD_NAMESPACE
44 # if defined (_STLP_DEBUG)
45 _STLP_MOVE_TO_PRIV_NAMESPACE
46 # define _STLP_NON_DBG_VECTOR _STLP_NON_DBG_NAME(vector)
47 _STLP_EXPORT_TEMPLATE_CLASS __construct_checker<_STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> > >;
48 _STLP_EXPORT_TEMPLATE_CLASS _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> >;
49 # undef _STLP_NON_DBG_VECTOR
50 _STLP_MOVE_TO_STD_NAMESPACE
53 _STLP_EXPORT_TEMPLATE_CLASS vector<locale::facet*, allocator<locale::facet*> >;
56 //----------------------------------------------------------------------
58 // This is the base class which implements access only and is supposed to
59 // be used for classic locale only
60 class _STLP_CLASS_DECLSPEC _Locale_impl : public _Refcount_Base {
62 _Locale_impl(const char* s);
63 _Locale_impl(const _Locale_impl&);
64 _Locale_impl(size_t n, const char* s);
70 size_t size() const { return facets_vec.size(); }
72 basic_string<char, char_traits<char>, allocator<char> > name;
74 static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_bad_cast();
77 void operator=(const _Locale_impl&);
80 class _STLP_CLASS_DECLSPEC Init {
85 _Refcount_Base& _M_count() const;
88 static void _STLP_CALL _S_initialize();
89 static void _STLP_CALL _S_uninitialize();
91 static void make_classic_locale();
92 static void free_classic_locale();
97 // void remove(size_t index);
98 locale::facet* insert(locale::facet*, size_t index);
99 void insert(_Locale_impl* from, const locale::id& n);
101 // Helper functions for byname construction of locales.
102 _Locale_name_hint* insert_ctype_facets(const char* name, _Locale_name_hint* hint);
103 _Locale_name_hint* insert_numeric_facets(const char* name, _Locale_name_hint* hint);
104 _Locale_name_hint* insert_time_facets(const char* name, _Locale_name_hint* hint);
105 _Locale_name_hint* insert_collate_facets(const char* name, _Locale_name_hint* hint);
106 _Locale_name_hint* insert_monetary_facets(const char* name, _Locale_name_hint* hint);
107 _Locale_name_hint* insert_messages_facets(const char* name, _Locale_name_hint* hint);
109 bool operator != (const locale& __loc) const { return __loc._M_impl != this; }
112 vector<locale::facet*> facets_vec;
115 friend _Locale_impl * _STLP_CALL _copy_Locale_impl( _Locale_impl * );
116 friend _STLP_IMPORT_DECLSPEC _Locale_impl * _STLP_CALL _copy_Nameless_Locale_impl( _Locale_impl * );
117 friend void _STLP_CALL _release_Locale_impl( _Locale_impl *& loc );
118 #if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
119 friend class _STLP_NO_MEM_T_NAME(loc);
125 void _STLP_CALL _release_Locale_impl( _Locale_impl *& loc );
126 _Locale_impl * _STLP_CALL _copy_Locale_impl( _Locale_impl *loc );