ReactOS  0.4.14-dev-77-gd9e7c48
_messages_facets.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
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.
16  *
17  */
18 
19 // WARNING: This is an internal header file, included by other C++
20 // standard library headers. You should not attempt to use this header
21 // file directly.
22 
23 
24 #ifndef _STLP_INTERNAL_MESSAGES_H
25 #define _STLP_INTERNAL_MESSAGES_H
26 
27 #ifndef _STLP_IOS_BASE_H
28 # include <stl/_ios_base.h>
29 #endif
30 
31 #ifndef _STLP_C_LOCALE_H
32 # include <stl/c_locale.h>
33 #endif
34 
35 #ifndef _STLP_INTERNAL_STRING_H
36 # include <stl/_string.h>
37 #endif
38 
40 
41 // messages facets
42 
44  public:
45  typedef int catalog;
46 };
47 
48 template <class _CharT> class messages {};
49 
51 class _Messages;
53 
56 public:
58  typedef char char_type;
59  typedef string string_type;
60 
61  explicit messages(size_t __refs = 0);
62 
63  catalog open(const string& __fn, const locale& __loc) const
64  { return do_open(__fn, __loc); }
65  string_type get(catalog __c, int __set, int __msgid,
66  const string_type& __dfault) const
67  { return do_get(__c, __set, __msgid, __dfault); }
68  inline void close(catalog __c) const
69  { do_close(__c); }
70 
72 
73 protected:
74  ~messages() {}
75 
76  virtual catalog do_open(const string& __fn, const locale& __loc) const
77  { return -1; }
78  virtual string_type do_get(catalog __c, int __set, int __msgid,
79  const string_type& __dfault) const
80  { return __dfault; }
81  virtual void do_close(catalog __c) const
82  {}
83 };
84 
85 #if !defined (_STLP_NO_WCHAR_T)
86 
89 public:
91  typedef wchar_t char_type;
92  typedef wstring string_type;
93 
94  explicit messages(size_t __refs = 0);
95 
96  inline catalog open(const string& __fn, const locale& __loc) const
97  { return do_open(__fn, __loc); }
98  inline string_type get(catalog __c, int __set, int __msgid,
99  const string_type& __dfault) const
100  { return do_get(__c, __set, __msgid, __dfault); }
101  inline void close(catalog __c) const
102  { do_close(__c); }
103 
105 
106 protected:
108 
109  virtual catalog do_open(const string& __fn, const locale& __loc) const
110  { return -1; }
111  virtual string_type do_get(catalog __c, int __set, int __msgid,
112  const string_type& __dfault) const
113  { return __dfault; }
114  virtual void do_close(catalog __c) const
115  {}
116 };
117 
118 #endif
119 
120 template <class _CharT> class messages_byname {};
121 
124  friend class _Locale_impl;
125 public:
127  typedef string string_type;
128 
129  explicit messages_byname(const char* __name, size_t __refs = 0);
130 
131 protected:
132  ~messages_byname();
133 
134  virtual catalog do_open(const string& __fn, const locale& __loc) const;
135  virtual string_type do_get(catalog __c, int __set, int __msgid,
136  const string_type& __dfault) const;
137  virtual void do_close(catalog __c) const;
138 
139 private:
140  messages_byname(_Locale_messages*);
142  //explicitely defined as private to avoid warnings:
143  messages_byname(_Self const&);
144  _Self& operator = (_Self const&);
145 
147 };
148 
149 #if !defined (_STLP_NO_WCHAR_T)
152  friend class _Locale_impl;
153 public:
155  typedef wstring string_type;
156 
157  explicit messages_byname(const char* __name, size_t __refs = 0);
158 
159 protected:
160  ~messages_byname();
161 
162  virtual catalog do_open(const string& __fn, const locale& __loc) const;
163  virtual string_type do_get(catalog __c, int __set, int __msgid,
164  const string_type& __dfault) const;
165  virtual void do_close(catalog __c) const;
166 
167 private:
168  messages_byname(_Locale_messages*);
170  //explicitely defined as private to avoid warnings:
171  messages_byname(_Self const&);
172  _Self& operator = (_Self const&);
173 
175 };
176 #endif /* WCHAR_T */
177 
179 
180 #endif /* _STLP_INTERNAL_MESSAGES_H */
181 
182 // Local Variables:
183 // mode:C++
184 // End:
185 
virtual void do_close(catalog __c) const
static _STLP_STATIC_DECLSPEC locale::id id
string_type get(catalog __c, int __set, int __msgid, const string_type &__dfault) const
_STLP_PRIV _Messages * _M_impl
void operator=(const _Locale_impl &)
#define __c
Definition: schilyio.h:209
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
Definition: _locale.h:75
static void do_close(SOCKET)
unsigned char
Definition: typeof.h:29
virtual string_type do_get(catalog __c, int __set, int __msgid, const string_type &__dfault) const
unsigned short wchar_t
Definition: crtdefs.h:324
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
void close(catalog __c) const
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_CLASS_DECLSPEC
Definition: features.h:983
#define _STLP_TEMPLATE_NULL
Definition: features.h:652
catalog open(const string &__fn, const locale &__loc) const
messages_byname< char > _Self
messages_byname< wchar_t > _Self
virtual void do_close(catalog __c) const
messages_base::catalog catalog
catalog open(const string &__fn, const locale &__loc) const
#define _STLP_END_NAMESPACE
Definition: features.h:503
_STLP_PRIV _Messages * _M_impl
messages_base::catalog catalog
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
messages_base::catalog catalog
#define _STLP_STATIC_DECLSPEC
Definition: features.h:992
virtual catalog do_open(const string &__fn, const locale &__loc) const
virtual catalog do_open(const string &__fn, const locale &__loc) const
virtual string_type do_get(catalog __c, int __set, int __msgid, const string_type &__dfault) const
messages_base::catalog catalog
static _STLP_STATIC_DECLSPEC locale::id id
static int do_open(IN OUT nfs41_open_state *state, IN uint32_t create, IN uint32_t createhow, IN nfs41_file_info *createattrs, IN bool_t try_recovery, OUT nfs41_file_info *info)
Definition: open.c:189
string_type get(catalog __c, int __set, int __msgid, const string_type &__dfault) const
void close(catalog __c) const