00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _STLP_INTERNAL_MESSAGES_H
00025 #define _STLP_INTERNAL_MESSAGES_H
00026
00027 #ifndef _STLP_IOS_BASE_H
00028 # include <stl/_ios_base.h>
00029 #endif
00030
00031 # ifndef _STLP_C_LOCALE_H
00032 # include <stl/c_locale.h>
00033 # endif
00034
00035 #ifndef _STLP_STRING_H
00036 # include <stl/_string.h>
00037 #endif
00038
00039 _STLP_BEGIN_NAMESPACE
00040
00041
00042
00043 class messages_base {
00044 public:
00045 typedef int catalog;
00046 };
00047
00048 template <class _CharT> class messages {};
00049
00050 class _Messages;
00051
00052 _STLP_TEMPLATE_NULL
00053 class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base
00054 {
00055 friend class _Locale;
00056 public:
00057 typedef messages_base::catalog catalog;
00058 typedef char char_type;
00059 typedef string string_type;
00060
00061 explicit messages(size_t __refs = 0);
00062
00063 catalog open(const string& __fn, const locale& __loc) const
00064 { return do_open(__fn, __loc); }
00065 string_type get(catalog __c, int __set, int __msgid,
00066 const string_type& __dfault) const
00067 { return do_get(__c, __set, __msgid, __dfault); }
00068 inline void close(catalog __c) const
00069 { do_close(__c); }
00070
00071 _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
00072
00073 messages(_Messages*);
00074
00075 protected:
00076 messages(size_t, _Locale_messages*);
00077 ~messages();
00078
00079 virtual catalog do_open(const string& __fn, const locale& __loc) const;
00080 virtual string_type do_get(catalog __c, int __set, int __msgid,
00081 const string_type& __dfault) const;
00082 virtual void do_close(catalog __c) const;
00083
00084 void _M_initialize(const char* __name);
00085
00086 private:
00087 _Messages* _M_impl;
00088 };
00089
00090 # if !defined (_STLP_NO_WCHAR_T)
00091
00092 _STLP_TEMPLATE_NULL
00093 class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base
00094 {
00095 friend class _Locale;
00096 public:
00097 typedef messages_base::catalog catalog;
00098 typedef wchar_t char_type;
00099 typedef wstring string_type;
00100
00101 explicit messages(size_t __refs = 0);
00102
00103 inline catalog open(const string& __fn, const locale& __loc) const
00104 { return do_open(__fn, __loc); }
00105 inline string_type get(catalog __c, int __set, int __msgid,
00106 const string_type& __dfault) const
00107 { return do_get(__c, __set, __msgid, __dfault); }
00108 inline void close(catalog __c) const
00109 { do_close(__c); }
00110
00111 _STLP_STATIC_MEMBER_DECLSPEC static locale::id id;
00112
00113 messages(_Messages*);
00114
00115 protected:
00116
00117 messages(size_t, _Locale_messages*);
00118 ~messages();
00119
00120 virtual catalog do_open(const string& __fn, const locale& __loc) const;
00121 virtual string_type do_get(catalog __c, int __set, int __msgid,
00122 const string_type& __dfault) const;
00123 virtual void do_close(catalog __c) const;
00124
00125 void _M_initialize(const char* __name);
00126
00127 private:
00128 _Messages* _M_impl;
00129 };
00130
00131 # endif
00132
00133 template <class _CharT> class messages_byname {};
00134
00135 _STLP_TEMPLATE_NULL
00136 class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
00137 public:
00138 typedef messages_base::catalog catalog;
00139 typedef string string_type;
00140
00141 explicit messages_byname(const char* __name, size_t __refs = 0);
00142
00143 protected:
00144 ~messages_byname();
00145 };
00146
00147 # ifndef _STLP_NO_WCHAR_T
00148 _STLP_TEMPLATE_NULL
00149 class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
00150 public:
00151 typedef messages_base::catalog catalog;
00152 typedef wstring string_type;
00153
00154 explicit messages_byname(const char* __name, size_t __refs = 0);
00155
00156 protected:
00157 ~messages_byname();
00158 };
00159 # endif
00160
00161 _STLP_END_NAMESPACE
00162
00163 #endif
00164
00165
00166
00167
00168