Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_messages.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_LOC_MESSAGES_H_INCLUDED
33#define _RWSTD_LOC_MESSAGES_H_INCLUDED
34
35
36#if __GNUG__ >= 3
37# pragma GCC system_header
38#endif // gcc >= 3
39
40
41#include <string>
42
43#include <loc/_facet.h>
44#include <loc/_codecvt.h>
45#include <loc/_locale.h>
46
47#include <rw/_defs.h>
48
49
51
52int __rw_cat_open (const _STD::string&, const _STD::locale&);
53
54const char* __rw_get_message (int, int, int);
55
56const _STD::locale& __rw_get_locale (int);
57
58void __rw_cat_close (int);
59
60} // namespace __rw
61
62
64
65
66struct _RWSTD_EXPORT messages_base
67{
68 typedef int catalog;
69};
70
71
72// 22.2.7.1
74template <class _CharT>
75class messages: public _RW::__rw_facet,
76 public messages_base
77{
78public:
79 typedef _CharT char_type;
80
81 typedef basic_string<char_type, char_traits<char_type>,
82 allocator<char_type> > string_type;
83
84 explicit messages (_RWSTD_SIZE_T __refs = 0)
85 : _RW::__rw_facet (__refs) { }
86
87 virtual ~messages () _RWSTD_ATTRIBUTE_NOTHROW;
88
89 catalog open (const string& __fun, const locale& __loc) const {
90 return do_open (__fun, __loc);
91 }
92
93 string_type get (catalog __c, int __set, int __msgid,
94 const string_type& __df) const {
95 return do_get (__c, __set, __msgid, __df);
96 }
97
98 void close (catalog __c) const {
99 do_close (__c);
100 }
101
102 static _RW::__rw_facet_id id;
103
104protected:
105
106 virtual catalog do_open (const string&, const locale&) const;
107
108 virtual string_type do_get (catalog, int, int, const string_type&) const;
109
110 virtual void do_close (catalog) const;
111};
112
113
114#ifndef _RWSTD_NO_SPECIALIZED_FACET_ID
115
117_RW::__rw_facet_id messages<char>::id;
118
119# ifndef _RWSTD_NO_WCHAR_T
120
122_RW::__rw_facet_id messages<wchar_t>::id;
123
124# endif // _RWSTD_NO_WCHAR_T
125#endif // _RWSTD_NO_SPECIALIZED_FACET_ID
126
127
128// 22.2.7.2
129template <class _CharT>
130class messages_byname: public messages<_CharT>
131{
132 char _C_namebuf [32];
133
134public:
135
136 explicit messages_byname (const char *__name, _RWSTD_SIZE_T __refs = 0)
137 : messages<_CharT>(__refs) {
138 this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
139 }
140
141 virtual ~messages_byname () _RWSTD_ATTRIBUTE_NOTHROW;
142};
143
144} // namespace std
145
146
147#if _RWSTD_DEFINE_TEMPLATE_FIRST (_MESSAGES)
148# include <loc/_messages.cc>
149#endif // _RWSTD_DEFINE_TEMPLATE_FIRST (MESSAGES)
150
151
152#ifdef _RWSTD_MSVC
153# pragma warning (push)
154# pragma warning (disable: 4231)
155#endif // _RWSTD_MSVC
156
157
159
160#if _RWSTD_INSTANTIATE (_MESSAGES, _CHAR)
161
162_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT messages<char>);
163
164#endif // _RWSTD_INSTANTIATE (_MESSAGES, _CHAR)
165
166#if _RWSTD_INSTANTIATE (_MESSAGES, _WCHAR_T)
167
168_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT messages<wchar_t>);
169
170#endif // _RWSTD_INSTANTIATE (_MESSAGES, _WCHAR_T)
171
172} // namespace std
173
174
175#ifdef _RWSTD_MSVC
176# pragma warning (pop)
177#endif // _RWSTD_MSVC
178
179
180#if _RWSTD_DEFINE_TEMPLATE_LAST (_MESSAGES)
181# include <loc/_messages.cc>
182#endif // _RWSTD_DEFINE_TEMPLATE_LAST (MESSAGES)
183
184
185#endif // _RWSTD_LOC_MESSAGES_H_INCLUDED
#define open(f, m)
#define close(f)
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_EXPORT
Definition _defs.h:485
#define _RWSTD_INSTANTIATE_1(arg)
Definition _defs.h:1374
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
#define _RWSTD_ATTRIBUTE_NOTHROW
Definition _defs.h:1179
#define _EXPORT
Definition _defs.h:498
#define _RWSTD_TI_EXPORT
Definition _defs.h:1331
Definition json.h:5363