time_get Class Template Reference

#include <locale_facets.h>

Inheritance diagram for time_get:

Inheritance graph
Collaboration diagram for time_get:

Collaboration graph
List of all members.

Detailed Description

template<typename CharT, typename InIter>
class std::time_get< CharT, InIter >

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 2984 of file locale_facets.h.

Public Types

Public Member Functions

Static Public Attributes

Protected Member Functions

Static Protected Member Functions


Member Typedef Documentation

typedef CharT char_type
 

Public typedefs.

Definition at line 2990 of file locale_facets.h.

Referenced by time_get::do_get_date(), time_get::do_get_monthname(), time_get::do_get_time(), and time_get::do_get_weekday().

typedef InIter iter_type
 

Public typedefs.

Definition at line 2991 of file locale_facets.h.

Referenced by time_get::do_get_date(), time_get::do_get_monthname(), time_get::do_get_time(), time_get::do_get_weekday(), and time_get::do_get_year().


Constructor & Destructor Documentation

time_get size_t  __refs = 0  )  [inline, explicit]
 

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters:
refs Passed to the base facet class.
Definition at line 3006 of file locale_facets.h.

virtual ~time_get  )  [inline, protected, virtual]
 

Destructor.

Definition at line 3162 of file locale_facets.h.


Member Function Documentation

dateorder date_order  )  const [inline]
 

Return preferred order of month, day, and year.

This function returns an enum from timebase::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 timebase::dateorder::noorder.

NOTE: The library always returns noorder at the moment.

Returns:
A member of timebase::dateorder.
Definition at line 3023 of file locale_facets.h.

References time_get::do_date_order().

time_base::dateorder do_date_order  )  const [protected, virtual]
 

Return preferred order of month, day, and year.

This function returns an enum from timebase::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.

Returns:
A member of timebase::dateorder.
Definition at line 1728 of file locale_facets.tcc.

Referenced by time_get::date_order().

InIter do_get_date iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [protected, virtual]
 

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.

See also:
get_date() for details.
Parameters:
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.
Returns:
Iterator to first char beyond date string.
Definition at line 2075 of file locale_facets.tcc.

References time_get::char_type, ios_base::iostate, and time_get::iter_type.

Referenced by time_get::get_date().

InIter do_get_monthname iter_type  __beg,
iter_type  __end,
ios_base ,
ios_base::iostate __err,
tm *  __tm
const [protected, virtual]
 

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.

See also:
get_monthname() for details.
Parameters:
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.
Returns:
Iterator to first char beyond month name.
Definition at line 2136 of file locale_facets.tcc.

References time_get::char_type, ios_base::iostate, and time_get::iter_type.

Referenced by time_get::get_monthname().

InIter do_get_time iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [protected, virtual]
 

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.

See also:
get_time() for details.
Parameters:
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.
Returns:
Iterator to first char beyond time string.
Definition at line 2058 of file locale_facets.tcc.

References time_get::char_type, ios_base::iostate, and time_get::iter_type.

Referenced by time_get::get_time().

InIter do_get_weekday iter_type  __beg,
iter_type  __end,
ios_base ,
ios_base::iostate __err,
tm *  __tm
const [protected, virtual]
 

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.

See also:
get_weekday() for details.
Parameters:
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.
Returns:
Iterator to first char beyond weekday name.
Definition at line 2092 of file locale_facets.tcc.

References time_get::char_type, ios_base::iostate, and time_get::iter_type.

Referenced by time_get::get_weekday().

InIter do_get_year iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [protected, virtual]
 

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.

See also:
get_year() for details.
Parameters:
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.
Returns:
Iterator to first char beyond year.
Definition at line 2182 of file locale_facets.tcc.

References ios_base::iostate, time_get::iter_type, and ctype_abstract_base::narrow().

Referenced by time_get::get_year().

iter_type get_date iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [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.

Parameters:
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.
Returns:
Iterator to first char beyond date string.
Definition at line 3072 of file locale_facets.h.

References time_get::do_get_date(), and ios_base::iostate.

iter_type get_monthname iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [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.

Parameters:
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.
Returns:
Iterator to first char beyond month name.
Definition at line 3129 of file locale_facets.h.

References time_get::do_get_monthname(), and ios_base::iostate.

iter_type get_time iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [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.

Parameters:
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.
Returns:
Iterator to first char beyond time string.
Definition at line 3047 of file locale_facets.h.

References time_get::do_get_time(), and ios_base::iostate.

iter_type get_weekday iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [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.

Parameters:
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.
Returns:
Iterator to first char beyond weekday name.
Definition at line 3100 of file locale_facets.h.

References time_get::do_get_weekday(), and ios_base::iostate.

iter_type get_year iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
tm *  __tm
const [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.

Parameters:
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.
Returns:
Iterator to first char beyond year.
Definition at line 3155 of file locale_facets.h.

References time_get::do_get_year(), and ios_base::iostate.


Member Data Documentation

locale::id id [static]
 

Numpunct facet id.

Definition at line 3293 of file locale_facets.h.


The documentation for this class was generated from the following files:
Generated on Sun Sep 12 15:50:27 2004 for libstdc++ source by doxygen 1.3.8