Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_time_get.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_LOC_TIME_GET_H_INCLUDED
33#define _RWSTD_LOC_TIME_GET_H_INCLUDED
34
35
36#if __GNUG__ >= 3
37# pragma GCC system_header
38#endif // gcc >= 3
39
40
41#include <loc/_facet.h>
42#include <rw/_ioiter.h>
43#include <rw/_iosfwd.h>
44#include <rw/_defs.h>
45
46#include _RWSTD_CTIME
47
48
50
51const void* __rw_get_timepunct (const _RW::__rw_facet*, int, _RWSTD_SIZE_T);
52
53} // namespace __rw
54
55
57
58
59// 22.2.5.1
60struct _RWSTD_EXPORT time_base
61{
62 enum dateorder { no_order, dmy, mdy, ymd, ydm };
63};
64
65
66// 22.2.5.1
68template <class _CharT, class _InputIter = istreambuf_iterator<_CharT> >
69class time_get: public _RW::__rw_facet, public time_base
70{
71public:
72 typedef _CharT char_type;
73 typedef _InputIter iter_type;
74
75 explicit time_get (_RWSTD_SIZE_T __ref = 0)
76 : _RW::__rw_facet (__ref) { }
77
78 virtual ~time_get () _RWSTD_ATTRIBUTE_NOTHROW;
79
80 dateorder date_order() const {
81 return do_date_order();
82 }
83
84 iter_type
85 get_time (iter_type __start, iter_type __end, ios_base &__flags,
86 _RWSTD_IOSTATE &__err, tm *__time) const {
87 return do_get_time (__start, __end, __flags, __err, __time);
88 }
89
90 iter_type
91 get_date (iter_type __start, iter_type __end, ios_base &__flags,
92 _RWSTD_IOSTATE &__err, tm *__time) const {
93 return do_get_date(__start, __end, __flags, __err, __time);
94 }
95
96 iter_type
97 get_weekday (iter_type __start, iter_type __end, ios_base &__flags,
98 _RWSTD_IOSTATE &__err, tm *__time) const {
99 return do_get_weekday (__start, __end, __flags, __err, __time);
100 }
101
102 iter_type
103 get_monthname (iter_type __start, iter_type __end, ios_base &__flags,
104 _RWSTD_IOSTATE &__err, tm *__time) const {
105 return do_get_monthname (__start, __end, __flags, __err, __time);
106 }
107
108 iter_type
109 get_year (iter_type __start, iter_type __end, ios_base &__flags,
110 _RWSTD_IOSTATE &__err, tm *__time) const {
111 return do_get_year (__start, __end, __flags, __err, __time);
112 }
113
114
115 static _RW::__rw_facet_id id;
116
117
118#ifdef _RWSTD_NO_EXT_TIME_GET
119
120private:
121
122#endif // _RWSTD_NO_EXT_TIME_GET
123
124 // extension
125 iter_type
126 get (iter_type, iter_type, ios_base&, _RWSTD_IOSTATE&, tm*,
127 const char_type*, const char_type*) const;
128
129 // extension
130 iter_type
131 get (iter_type __it, iter_type __end, ios_base &__flags,
132 _RWSTD_IOSTATE &__err, tm *__time,
133 char __fmt, char __modifier = '\0') const {
134 return do_get (__it, __end, __flags, __err, __time, __fmt, __modifier);
135 }
136
137protected:
138
139 virtual dateorder do_date_order() const {
140 return dateorder ();
141 }
142
143 virtual iter_type
144 do_get_time (iter_type __it, iter_type __end, ios_base &__fl,
145 _RWSTD_IOSTATE &__err, tm *__tmb) const {
146 return do_get (__it, __end, __fl, __err, __tmb, 'X');
147 }
148
149 virtual iter_type
150 do_get_date (iter_type __it, iter_type __end, ios_base &__fl,
151 _RWSTD_IOSTATE &__err, tm *__tmb) const {
152 return do_get (__it, __end, __fl, __err, __tmb, 'x');
153 }
154
155 virtual iter_type
156 do_get_weekday (iter_type __it, iter_type __end, ios_base &__fl,
157 _RWSTD_IOSTATE &__err, tm *__tmb) const {
158 return do_get (__it, __end, __fl, __err, __tmb, 'a');
159 }
160
161 virtual iter_type
162 do_get_monthname (iter_type __it, iter_type __end, ios_base &__fl,
163 _RWSTD_IOSTATE &__err, tm *__tmb) const {
164 return do_get (__it, __end, __fl, __err, __tmb, 'b');
165 }
166
167 virtual iter_type
168 do_get_year (iter_type __it, iter_type __end, ios_base &__fl,
169 _RWSTD_IOSTATE &__err, tm *__tmb) const {
170 return do_get (__it, __end, __fl, __err, __tmb, 'Y');
171 }
172
173#ifdef _RWSTD_NO_EXT_TIME_GET
174
175private:
176
177#endif // _RWSTD_NO_EXT_TIME_GET
178
179 // extension
180 virtual iter_type
181 do_get (iter_type, iter_type, ios_base&, _RWSTD_IOSTATE&, tm*,
182 char, char = '\0') const;
183};
184
185
186#ifndef _RWSTD_NO_SPECIALIZED_FACET_ID
187
189_RW::__rw_facet_id time_get<char, istreambuf_iterator<char> >::id;
190
191# ifndef _RWSTD_NO_WCHAR_T
192
194_RW::__rw_facet_id time_get<wchar_t, istreambuf_iterator<wchar_t> >::id;
195
196# endif // _RWSTD_NO_WCHAR_T
197#endif // _RWSTD_NO_SPECIALIZED_FACET_ID
198
199
200// 22.2.5.2
201template <class _CharT, class _InputIter = istreambuf_iterator<_CharT> >
202class time_get_byname: public time_get<_CharT, _InputIter>
203{
204 char _C_namebuf [32];
205
206public:
207
208 explicit time_get_byname (const char *__name, _RWSTD_SIZE_T __ref = 0)
209 : time_get<_CharT, _InputIter>(__ref) {
210 this->_C_set_name (__name, _C_namebuf, sizeof _C_namebuf);
211 }
212
213 virtual ~time_get_byname () _RWSTD_ATTRIBUTE_NOTHROW;
214};
215
216} // namespace std
217
218
219#if _RWSTD_DEFINE_TEMPLATE_FIRST (_TIME_GET)
220# include <loc/_time_get.cc>
221#endif // _RWSTD_DEFINE_TEMPLATE_FIRST (_TIME_GET)
222
223
224#ifdef _RWSTD_MSVC
225# pragma warning (push)
226# pragma warning (disable: 4231)
227#endif // _RWSTD_MSVC
228
229
231
232#if _RWSTD_INSTANTIATE (_TIME_GET, _CHAR)
233
234_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT time_get<char>);
235
236#endif // _RWSTD_INSTANTIATE (_TIME_GET, _CHAR)
237
238#if _RWSTD_INSTANTIATE (_TIME_GET, _WCHAR_T)
239
240_RWSTD_INSTANTIATE_1 (class _RWSTD_TI_EXPORT time_get<wchar_t>);
241
242#endif // _RWSTD_INSTANTIATE (_TIME_GET, _WCHAR_T)
243
244} // namespace std
245
246
247#ifdef _RWSTD_MSVC
248# pragma warning (pop)
249#endif // _RWSTD_MSVC
250
251
252#if _RWSTD_DEFINE_TEMPLATE_LAST (_TIME_GET)
253# include <loc/_time_get.cc>
254#endif // _RWSTD_DEFINE_TEMPLATE_LAST (_TIME_GET)
255
256
257#endif // _RWSTD_LOC_TIME_GET_H_INCLUDED
#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
#define _RWSTD_IOSTATE
Definition _iosfwd.h:91
Definition json.h:5363
std::__rw_smanip< time_get_manip< charT >, const charT * > get_time(std::tm *tmb, const charT *fmt)