_messages_facets.h

00001 /*
00002  * Copyright (c) 1999
00003  * Silicon Graphics Computer Systems, Inc.
00004  *
00005  * Copyright (c) 1999 
00006  * Boris Fomitchev
00007  *
00008  * This material is provided "as is", with absolutely no warranty expressed
00009  * or implied. Any use is at your own risk.
00010  *
00011  * Permission to use or copy this software for any purpose is hereby granted 
00012  * without fee, provided the above notices are retained on all copies.
00013  * Permission to modify the code and to distribute modified code is granted,
00014  * provided the above notices are retained, and a notice that the code was
00015  * modified is included with the above copyright notice.
00016  *
00017  */ 
00018 
00019 // WARNING: This is an internal header file, included by other C++
00020 // standard library headers.  You should not attempt to use this header
00021 // file directly.
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 // messages facets
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 /* WCHAR_T */
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 /* WCHAR_T */
00160 
00161 _STLP_END_NAMESPACE
00162 
00163 #endif /* _STLP_INTERNAL_MESSAGES_H */
00164 
00165 // Local Variables:
00166 // mode:C++
00167 // End:
00168 

Generated on Mon Jun 5 10:20:46 2006 for Intelligence.kdevelop by  doxygen 1.4.6