Go to the source code of this file.
|
| template<class _InIt , class _NameIt > |
| size_t _STLP_CALL | __match (_InIt &__first, _InIt &__last, _NameIt __name, _NameIt __name_end) |
| |
| template<class _InIt1 , class _Ch , class _TimeInfo > |
| string::const_iterator _STLP_CALL __get_formatted_time | _STLP_WEAK (_InIt1 __first, _InIt1 __last, string::const_iterator __format, string::const_iterator __format_end, _Ch *, const _TimeInfo &__table, const ios_base &__s, ios_base::iostate &__err, tm *__t) |
| |
| template<class _InIt , class _TimeInfo > |
| bool _STLP_CALL | __get_short_or_long_dayname (_InIt &__first, _InIt &__last, const _TimeInfo &__table, tm *__t) |
| |
| template<class _InIt , class _TimeInfo > |
| bool _STLP_CALL | __get_short_or_long_monthname (_InIt &__first, _InIt &__last, const _TimeInfo &__table, tm *__t) |
| |
◆ _MAXNAMES
◆ _STLP_TIME_FACETS_C
◆ __get_short_or_long_dayname()
| bool _STLP_CALL __get_short_or_long_dayname |
( |
_InIt & |
__first, |
|
|
_InIt & |
__last, |
|
|
const _TimeInfo & |
__table, |
|
|
tm * |
__t |
|
) |
| |
Definition at line 281 of file _time_facets.c.
281 {
282 size_t __index =
__match(__first,
__last, __table._M_dayname + 0, __table._M_dayname + 14);
283 if (__index != 14) {
285 return true;
286 }
287 return false;
288}
_STLP_INLINE_LOOP _InputIter __last
size_t _STLP_CALL __match(_InIt &__first, _InIt &__last, _NameIt __name, _NameIt __name_end)
#define __STATIC_CAST(__x, __y)
Referenced by time_get< _Ch, _InIt >::do_get_weekday().
◆ __get_short_or_long_monthname()
| bool _STLP_CALL __get_short_or_long_monthname |
( |
_InIt & |
__first, |
|
|
_InIt & |
__last, |
|
|
const _TimeInfo & |
__table, |
|
|
tm * |
__t |
|
) |
| |
◆ __match()
| size_t _STLP_CALL __match |
( |
_InIt & |
__first, |
|
|
_InIt & |
__last, |
|
|
_NameIt |
__name, |
|
|
_NameIt |
__name_end |
|
) |
| |
Definition at line 78 of file _time_facets.c.
78 {
80 difference_type
__n = __name_end - __name;
81 difference_type
__i, __start = 0;
82 size_t __pos = 0;
83 difference_type __check_count =
__n;
85 size_t __matching_name_index =
__n;
86
87 memset(__do_not_check, 0,
sizeof(__do_not_check));
88
89 while (__first !=
__last) {
90 difference_type __new_n =
__n;
92 if (!__do_not_check[
__i]) {
93 if (*__first == __name[
__i][__pos]) {
94 if (__pos == (__name[
__i].
size() - 1)) {
95 __matching_name_index =
__i;
96 __do_not_check[
__i] =
true;
97 if (
__i == __start) ++__start;
98 --__check_count;
99 if (__check_count == 0) {
100 ++__first;
101 return __matching_name_index;
102 }
103 }
105 }
106 else {
107 __do_not_check[
__i] =
true;
108 if (
__i == __start) ++__start;
109 --__check_count;
110 if (__check_count == 0)
111 return __matching_name_index;
112 }
113 }
114 else {
115 if (
__i == __start) ++ __start;
116 }
117 }
118
120 ++__first; ++__pos;
121 }
122
123 return __matching_name_index;
124}
Referenced by __get_short_or_long_dayname(), __get_short_or_long_monthname(), and time_get< _Ch, istreambuf_iterator< _Ch, char_traits< _Ch > > >::do_get_time().
◆ _STLP_WEAK()
| string::const_iterator _STLP_CALL __get_formatted_time _STLP_WEAK |
( |
_InIt1 |
__first, |
|
|
_InIt1 |
__last, |
|
|
string::const_iterator |
__format, |
|
|
string::const_iterator |
__format_end, |
|
|
_Ch * |
, |
|
|
const _TimeInfo & |
__table, |
|
|
const ios_base & |
__s, |
|
|
ios_base::iostate & |
__err, |
|
|
tm * |
__t |
|
) |
| |
Definition at line 149 of file _time_facets.c.
152 {
156
157 while (__first !=
__last && __format != __format_end) {
159 if (*__format == '%') {
160 ++__format;
161 char __c = *__format;
163 ++__format;
165 }
166
168 case 'A':
170 case 'a': {
172 __table._M_dayname +
offset, __table._M_dayname +
offset + 7);
173 if (__index == 7)
174 return __format;
176 break;
177 }
178
179 case 'B':
181 case 'b': {
183 __table._M_monthname +
offset, __table._M_monthname +
offset + 12);
184 if (__index == 12)
185 return __format;
187 break;
188 }
189
190 case 'd': {
193 __err |= ios_base::failbit;
194 return __format;
195 }
196 break;
197 }
198
199 case 'H': case 'I': {
201 if (!__pr)
202 return __format;
203 break;
204 }
205
206 case 'j': {
208 if (!__pr)
209 return __format;
210 break;
211 }
212
213 case 'm': {
217 __err |= ios_base::failbit;
218 return __format;
219 }
220 break;
221 }
222
223 case 'M': {
225 if (!__pr)
226 return __format;
227 break;
228 }
229
230 case 'p': {
232 __table._M_am_pm + 0, __table._M_am_pm + 2);
233 if (__index == 2)
234 return __format;
235
236 if (__index == 1 && __t->
tm_hour != 12 )
238 if (__index == 0 && __t->
tm_hour == 12 )
240 break;
241 }
242
243 case 'S': {
245 if (!__pr)
246 return __format;
247 break;
248 }
249
250 case 'y': {
252 if (!__pr)
253 return __format;
254 break;
255 }
256
257 case 'Y': {
260 if (!__pr)
261 return __format;
262 break;
263 }
264
265 default:
266 break;
267 }
268 }
269 else {
270 if (*__first++ != __ct.widen(*__format)) break;
271 }
272
273 ++__format;
274 }
275
276 return __format;
277}
bool _STLP_CALL __get_decimal_integer(_InputIter &__first, _InputIter &__last, _Integer &__val, _CharT *)
_Check_return_ wchar_t _Ch