PageRenderTime 35ms CodeModel.GetById 18ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 1ms

/project/jni/stlport/stlport/stl/_messages_facets.h

https://github.com/aichunyu/FFPlayer
C Header | 181 lines | 111 code | 44 blank | 26 comment | 0 complexity | de62728c552721e570e450cb627c61e6 MD5 | raw 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
 39_STLP_BEGIN_NAMESPACE
 40
 41// messages facets
 42
 43class messages_base {
 44  public:
 45    typedef int catalog;
 46};
 47
 48template <class _CharT> class messages {};
 49
 50_STLP_MOVE_TO_PRIV_NAMESPACE
 51class _Messages;
 52_STLP_MOVE_TO_STD_NAMESPACE
 53
 54_STLP_TEMPLATE_NULL
 55class _STLP_CLASS_DECLSPEC messages<char> : public locale::facet, public messages_base {
 56  friend class _Locale_impl;
 57public:
 58  typedef messages_base::catalog catalog;
 59  typedef char                   char_type;
 60  typedef string    string_type;
 61
 62  explicit messages(size_t __refs = 0);
 63
 64  catalog open(const string& __fn, const locale& __loc) const
 65  { return do_open(__fn, __loc); }
 66  string_type get(catalog __c, int __set, int __msgid,
 67                  const string_type& __dfault) const
 68  { return do_get(__c, __set, __msgid, __dfault); }
 69  inline void close(catalog __c) const
 70  { do_close(__c); }
 71
 72  static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
 73
 74private:
 75  messages(_STLP_PRIV _Messages*);
 76
 77protected:
 78  messages(size_t, _Locale_messages*);
 79  ~messages();
 80
 81  virtual catalog     do_open(const string& __fn, const locale& __loc) const;
 82  virtual string_type do_get(catalog __c, int __set, int __msgid,
 83                             const string_type& __dfault) const;
 84  virtual void        do_close(catalog __c) const;
 85
 86  void _M_initialize(const char* __name);
 87
 88private:
 89  _STLP_PRIV _Messages* _M_impl;
 90};
 91
 92#if !defined (_STLP_NO_WCHAR_T)
 93
 94_STLP_TEMPLATE_NULL
 95class _STLP_CLASS_DECLSPEC messages<wchar_t> : public locale::facet, public messages_base {
 96  friend class _Locale_impl;
 97public:
 98  typedef messages_base::catalog catalog;
 99  typedef wchar_t                char_type;
100  typedef wstring  string_type;
101
102  explicit messages(size_t __refs = 0);
103
104  inline catalog open(const string& __fn, const locale& __loc) const
105    { return do_open(__fn, __loc); }
106  inline string_type get(catalog __c, int __set, int __msgid,
107                         const string_type& __dfault) const
108    { return do_get(__c, __set, __msgid, __dfault); }
109  inline void close(catalog __c) const
110    { do_close(__c); }
111
112  static _STLP_STATIC_MEMBER_DECLSPEC locale::id id;
113
114private:
115  messages(_STLP_PRIV _Messages*);
116
117protected:
118  messages(size_t, _Locale_messages*);
119  ~messages();
120
121  virtual catalog     do_open(const string& __fn, const locale& __loc) const;
122  virtual string_type do_get(catalog __c, int __set, int __msgid,
123                             const string_type& __dfault) const;
124  virtual void        do_close(catalog __c) const;
125
126  void _M_initialize(const char* __name);
127
128private:
129  _STLP_PRIV _Messages* _M_impl;
130};
131
132#endif
133
134template <class _CharT> class messages_byname {};
135
136_STLP_TEMPLATE_NULL
137class _STLP_CLASS_DECLSPEC messages_byname<char> : public messages<char> {
138public:
139  typedef messages_base::catalog catalog;
140  typedef string     string_type;
141
142  explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
143
144protected:
145  ~messages_byname();
146
147private:
148  typedef messages_byname<char> _Self;
149  //explicitely defined as private to avoid warnings:
150  messages_byname(_Self const&);
151  _Self& operator = (_Self const&);
152};
153
154#if !defined (_STLP_NO_WCHAR_T)
155_STLP_TEMPLATE_NULL
156class _STLP_CLASS_DECLSPEC messages_byname<wchar_t> : public messages<wchar_t> {
157public:
158  typedef messages_base::catalog catalog;
159  typedef wstring                string_type;
160
161  explicit messages_byname(const char* __name, size_t __refs = 0, _Locale_name_hint* __hint = 0);
162
163protected:
164  ~messages_byname();
165
166private:
167  typedef messages_byname<wchar_t> _Self;
168  //explicitely defined as private to avoid warnings:
169  messages_byname(_Self const&);
170  _Self& operator = (_Self const&);
171};
172#endif /* WCHAR_T */
173
174_STLP_END_NAMESPACE
175
176#endif /* _STLP_INTERNAL_MESSAGES_H */
177
178// Local Variables:
179// mode:C++
180// End:
181