ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_messages_facets.h
Go to the documentation of this file.
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_INTERNAL_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 _STLP_MOVE_TO_PRIV_NAMESPACE
00051 class _Messages;
00052 _STLP_MOVE_TO_STD_NAMESPACE
00053 
00054 _STLP_TEMPLATE_NULL
00055 class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
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   static _STLP_STATIC_DECLSPEC locale::id id;
00072 
00073 protected:
00074   ~messages() {}
00075 
00076   virtual catalog     do_open(const string& __fn, const locale& __loc) const
00077   { return -1; }
00078   virtual string_type do_get(catalog __c, int __set, int __msgid,
00079                              const string_type& __dfault) const
00080   { return __dfault; }
00081   virtual void        do_close(catalog __c) const
00082   {}
00083 };
00084 
00085 #if !defined (_STLP_NO_WCHAR_T)
00086 
00087 _STLP_TEMPLATE_NULL
00088 class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
00089 public:
00090   typedef messages_base::catalog catalog;
00091   typedef wchar_t                char_type;
00092   typedef wstring                string_type;
00093 
00094   explicit messages(size_t __refs = 0);
00095 
00096   inline catalog open(const string& __fn, const locale& __loc) const
00097   { return do_open(__fn, __loc); }
00098   inline string_type get(catalog __c, int __set, int __msgid,
00099                          const string_type& __dfault) const
00100   { return do_get(__c, __set, __msgid, __dfault); }
00101   inline void close(catalog __c) const
00102   { do_close(__c); }
00103 
00104   static _STLP_STATIC_DECLSPEC locale::id id;
00105 
00106 protected:
00107   ~messages() {}
00108 
00109   virtual catalog     do_open(const string& __fn, const locale& __loc) const
00110   { return -1; }
00111   virtual string_type do_get(catalog __c, int __set, int __msgid,
00112                              const string_type& __dfault) const
00113   { return __dfault; }
00114   virtual void        do_close(catalog __c) const
00115   {}
00116 };
00117 
00118 #endif
00119 
00120 template <class _CharT> class messages_byname {};
00121 
00122 _STLP_TEMPLATE_NULL
00123 class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
00124   friend class _Locale_impl;
00125 public:
00126   typedef messages_base::catalog catalog;
00127   typedef string     string_type;
00128 
00129   explicit messages_byname(const char* __name, size_t __refs = 0);
00130 
00131 protected:
00132   ~messages_byname();
00133 
00134   virtual catalog     do_open(const string& __fn, const locale& __loc) const;
00135   virtual string_type do_get(catalog __c, int __set, int __msgid,
00136                              const string_type& __dfault) const;
00137   virtual void        do_close(catalog __c) const;
00138 
00139 private:
00140   messages_byname(_Locale_messages*);
00141   typedef messages_byname<char> _Self;
00142   //explicitely defined as private to avoid warnings:
00143   messages_byname(_Self const&);
00144   _Self& operator = (_Self const&);
00145 
00146   _STLP_PRIV _Messages* _M_impl;
00147 };
00148 
00149 #if !defined (_STLP_NO_WCHAR_T)
00150 _STLP_TEMPLATE_NULL
00151 class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
00152   friend class _Locale_impl;
00153 public:
00154   typedef messages_base::catalog catalog;
00155   typedef wstring                string_type;
00156 
00157   explicit messages_byname(const char* __name, size_t __refs = 0);
00158 
00159 protected:
00160   ~messages_byname();
00161 
00162   virtual catalog     do_open(const string& __fn, const locale& __loc) const;
00163   virtual string_type do_get(catalog __c, int __set, int __msgid,
00164                              const string_type& __dfault) const;
00165   virtual void        do_close(catalog __c) const;
00166 
00167 private:
00168   messages_byname(_Locale_messages*);
00169   typedef messages_byname<wchar_t> _Self;
00170   //explicitely defined as private to avoid warnings:
00171   messages_byname(_Self const&);
00172   _Self& operator = (_Self const&);
00173 
00174   _STLP_PRIV _Messages* _M_impl;
00175 };
00176 #endif /* WCHAR_T */
00177 
00178 _STLP_END_NAMESPACE
00179 
00180 #endif /* _STLP_INTERNAL_MESSAGES_H */
00181 
00182 // Local Variables:
00183 // mode:C++
00184 // End:
00185 

Generated on Sun May 27 2012 04:29:18 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.