Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

time_get


inherits fromtime_get_base time_get inherits fromlocale::facet

Summary

A time formatting facet for input.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <locale>
class time_base;
template <class charT, class InputIterator = 
          istreambuf_iterator<charT> >
class time_get;

Description

The time_get facet extracts time and date components from a character string and stores the resulting values in a struct tm argument. The facet parses the string using a specific format as a guide. If the string does not fit the format, then the facet indicates an error by setting the err argument in the public member functions to iosbase::failbit. See member function descriptions for details.

The time_base class includes a set of values for specifying the order in which the three parts of a date appear. The dateorder function returns one of these five possible values:

Order Meaning
noorder
Date format has no set ordering
dmy
Date order is day, month, year
mdy
Date order is month, day, year
ymd
Date order is year, month, day
ydm
Date order is year, day, month

Interface

Types

char_type
iter_type

Constructors

explicit time_get(size_t refs = 0) 

Destructors

~time_get();  // virtual and protected

Facet ID

static locale::id id;

Public Member Functions

dateorder 
date_order()  const; 
iter_type 
get_date(iter_type s, iter_type end, ios_base& f,
         ios_base::iostate& err, tm* t)  const; 
iter_type 
get_monthname(iter_type s, iter_type end, ios_base& f,
              ios_base::iostate& err, tm* t) const; 
iter_type 
get_time(iter_type s, iter_type end, ios_base& f,
         ios_base::iostate& err, tm* t)  const; 
iter_type 
get_weekday(iter_type s, iter_type end, ios_base& f,
            ios_base::iostate& err, tm* t) const; 
iter_type 
get_year(iter_type s, iter_type end, ios_base& f,
         ios_base::iostate& err, tm* t) const; 

Protected Member Functions

virtual dateorder 
do_date_order()  const; 
virtual iter_type 
do_get_date(iter_type s, iter_type end, ios_base&,
            ios_base::iostate& err, tm* t) const; 
virtual iter_type 
do_get_monthname(iter_type s, ios_base&,
                 ios_base::iostate& err, tm* t) const; 
virtual iter_type 
do_get_time(iter_type s, iter_type end, os_base&,
            ios_base::iostate& err, tm* t) const; 
virtual iter_type 
do_get_weekday(iter_type s, iter_type end, os_base&, 
               ios_base::iostate& err, tm* t) const; 
virtual iter_type 
do_get_year(iter_type s, iter_type end, ios_base&, 
            ios_base::iostate& err, tm* t) const; 

Example

See Also

locale, facets, time_put



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998