libstdc++
|
Public Types | |
enum | dateorder { no_order, dmy, mdy, ymd, ydm } |
typedef _CharT | char_type |
typedef _InIter | iter_type |
Public Member Functions | |
time_get (size_t __refs=0) | |
dateorder | date_order () const |
iter_type | get (iter_type __s, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, char __format, char __modifier=0) const |
iter_type | get (iter_type __s, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, const char_type *__fmt, const char_type *__fmtend) const |
iter_type | get_date (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
iter_type | get_monthname (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
iter_type | get_time (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
iter_type | get_weekday (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
iter_type | get_year (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
Static Public Attributes | |
static locale::id | id |
Protected Member Functions | |
virtual | ~time_get () |
iter_type | _M_extract_name (iter_type __beg, iter_type __end, int &__member, const _CharT **__names, size_t __indexlen, ios_base &__io, ios_base::iostate &__err) const |
iter_type | _M_extract_num (iter_type __beg, iter_type __end, int &__member, int __min, int __max, size_t __len, ios_base &__io, ios_base::iostate &__err) const |
iter_type | _M_extract_via_format (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, const _CharT *__format) const |
iter_type | _M_extract_wday_or_month (iter_type __beg, iter_type __end, int &__member, const _CharT **__names, size_t __indexlen, ios_base &__io, ios_base::iostate &__err) const |
virtual dateorder | do_date_order () const |
iter_type | do_get (iter_type __s, iter_type __end, ios_base &__f, ios_base::iostate &__err, tm *__tm, char __format, char __modifier) const |
virtual iter_type | do_get_date (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
virtual iter_type | do_get_monthname (iter_type __beg, iter_type __end, ios_base &, ios_base::iostate &__err, tm *__tm) const |
virtual iter_type | do_get_time (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
virtual iter_type | do_get_weekday (iter_type __beg, iter_type __end, ios_base &, ios_base::iostate &__err, tm *__tm) const |
virtual iter_type | do_get_year (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) const |
Primary class template time_get.
This facet encapsulates the code to parse and return a date or time from a string. It is used by the istream numeric extraction operators.
The time_get template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the time_get facet.
Definition at line 366 of file locale_facets_nonio.h.
typedef _CharT std::time_get< _CharT, _InIter >::char_type |
Public typedefs.
Definition at line 372 of file locale_facets_nonio.h.
typedef _InIter std::time_get< _CharT, _InIter >::iter_type |
Public typedefs.
Definition at line 373 of file locale_facets_nonio.h.
|
inlineexplicit |
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Definition at line 387 of file locale_facets_nonio.h.
|
inlineprotectedvirtual |
Destructor.
Definition at line 591 of file locale_facets_nonio.h.
|
inline |
Return preferred order of month, day, and year.
This function returns an enum from time_base::dateorder giving the preferred ordering if the format x given to time_put::put() only uses month, day, and year. If the format x for the associated locale uses other fields, this function returns time_base::dateorder::noorder.
NOTE: The library always returns noorder at the moment.
Definition at line 404 of file locale_facets_nonio.h.
|
protectedvirtual |
Return preferred order of month, day, and year.
This function returns an enum from time_base::dateorder giving the preferred ordering if the format x given to time_put::put() only uses month, day, and year. This function is a hook for derived classes to change the value returned.
Definition at line 626 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::time_get< _CharT, _InIter >::do_get_time(), std::ios_base::failbit, std::ios_base::goodbit, std::min(), std::__ctype_abstract_base< _CharT >::narrow(), and std::__ctype_abstract_base< _CharT >::toupper().
|
inlineprotected |
Parse input string according to format.
This function parses the string according to the provided format and optional modifier. This function is a hook for derived classes to change the value returned.
__s | Start of string to parse. |
__end | End of string to parse. |
__f | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
__format | Format specifier. |
__modifier | Format modifier. |
Definition at line 1244 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, std::ios_base::goodbit, std::time_put< _CharT, _OutIter >::put(), and std::__ctype_abstract_base< _CharT >::widen().
Referenced by std::time_get< _CharT, _InIter >::get().
|
protectedvirtual |
Parse input date string.
This function parses a date according to the format X and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 1076 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::time_get< _CharT, _InIter >::do_get_weekday(), and std::ios_base::eofbit.
Referenced by std::time_get< _CharT, _InIter >::do_get_time().
|
protectedvirtual |
Parse input month string.
This function parses a month name and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 1120 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::time_get< _CharT, _InIter >::do_get_year(), std::ios_base::eofbit, std::ios_base::failbit, and std::ios_base::goodbit.
Referenced by std::time_get< _CharT, _InIter >::do_get_weekday().
|
protectedvirtual |
Parse input time string.
This function parses a time according to the format x and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 1059 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::time_get< _CharT, _InIter >::do_get_date(), and std::ios_base::eofbit.
Referenced by std::time_get< _CharT, _InIter >::do_date_order().
|
protectedvirtual |
Parse input weekday string.
This function parses a weekday name and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 1093 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::ios_base::eofbit, std::ios_base::failbit, and std::ios_base::goodbit.
Referenced by std::time_get< _CharT, _InIter >::do_get_date().
|
protectedvirtual |
Parse input year string.
This function reads up to 4 characters to parse a year string and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 1147 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, std::ios_base::failbit, std::time_get< _CharT, _InIter >::get(), and std::ios_base::goodbit.
Referenced by std::time_get< _CharT, _InIter >::do_get_monthname().
|
inline |
Parse input string according to format.
This function calls time_get::do_get with the provided parameters.
__s | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
__format | Format specifier. |
__modifier | Format modifier. |
Definition at line 557 of file locale_facets_nonio.h.
Referenced by std::time_get< _CharT, _InIter >::do_get_year().
|
inline |
Parse input string according to format.
This function parses the input string according to a provided format string. It does the inverse of time_put::put. The format string follows the format specified for strftime(3)/strptime(3). The actual parsing is done by time_get::do_get.
__s | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
__fmt | Start of the format string. |
__fmtend | End of the format string. |
Definition at line 1172 of file locale_facets_nonio.tcc.
References std::ios_base::_M_getloc(), std::time_get< _CharT, _InIter >::do_get(), std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::__ctype_abstract_base< _CharT >::is(), std::__ctype_abstract_base< _CharT >::narrow(), std::__ctype_abstract_base< _CharT >::tolower(), and std::__ctype_abstract_base< _CharT >::toupper().
|
inline |
Parse input date string.
This function parses a date according to the format x and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_date().
If there is a valid date string according to format x, tm will be filled in accordingly and the returned iterator will point to the first character beyond the date string. If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 453 of file locale_facets_nonio.h.
|
inline |
Parse input month string.
This function parses a month name and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_monthname().
Parsing starts by parsing an abbreviated month name. If a valid abbreviation is followed by a character that would lead to the full month name, parsing continues until the full name is found or an error occurs. Otherwise parsing finishes at the end of the abbreviated name.
If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 510 of file locale_facets_nonio.h.
|
inline |
Parse input time string.
This function parses a time according to the format X and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_time().
If there is a valid time string according to format X, tm will be filled in accordingly and the returned iterator will point to the first character beyond the time string. If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 428 of file locale_facets_nonio.h.
|
inline |
Parse input weekday string.
This function parses a weekday name and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_weekday().
Parsing starts by parsing an abbreviated weekday name. If a valid abbreviation is followed by a character that would lead to the full weekday name, parsing continues until the full name is found or an error occurs. Otherwise parsing finishes at the end of the abbreviated name.
If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 481 of file locale_facets_nonio.h.
|
inline |
Parse input year string.
This function reads up to 4 characters to parse a year string and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_year().
4 consecutive digits are interpreted as a full year. If there are exactly 2 consecutive digits, the library interprets this as the number of years since 1900.
If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Definition at line 536 of file locale_facets_nonio.h.
|
static |
Numpunct facet id.
Definition at line 377 of file locale_facets_nonio.h.