Thursday, February 4, 2010

time_get









Class Name time_get

Header File <locale>

Classification abstract data type



Class Relationship Diagram



Class Description

Member Classes


locale::id

Methods





dateorder date_order() const;


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,
ios_base&, ios_base::iostate& err, tm* t) const;


virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_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;


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;


explicit time_get(size_t refs = 0);


~time_get();






Class Description



The time_get class describes a class used to parse character sequences and
extract the components of time or dates. The get member functions will parse
a particular format produced by time_put< >::put format specifier.






locale::id



locale::id is a class used to provide an identification of a locale facet interfaces used as
an index for lookup and to encapsulate initialization.








Method date_order()

Access Public

Classification Accessor

Syntax dateorder date_order() const;

Parameters None

Returns This method returns a value which describes
the preferred order of the date components
composed of day, month and year.



Description



The date_order() member function returns do_date_order().







Method do_date_order()

Access Protected

Classification Accessor

Syntax virtual dateorder do_date_order() const;

Parameters None

Returns This method returns a value which describes
the preferred order of the date components
composed of day, month and year.



Description



The do_date_order() method returns a value of
type dateorder which describes the preferred order of the date components
composed of day, month and year. The method returns no_order if the
date format contains other components (e.g. Julian day, week number, week day).







Method do_get_date()

Access Protected

Classification Accessor

Syntax virtual iter_type do_get_date(iter_type s,
iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the beginning
character of a character sequence.

end is an input iterator that points to the end
character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the date field is
stored.


Returns This method returns an iterator that points
immediately beyond the last character of the valid
date field.



Description



The do_get_date() method reads the characters from the
character sequence (s, end] until it has extracted the members of the struct
tm and the all of the remaining format characters that were used by
time_put< >::put object. Characters are extracted until all the members of the
struct tm has been removed, until an error has been encountered or the end of
the sequence has been reached. The results are stored in the struct tm. It returns
an iterator that points immediately beyond the last character of the valid date field.
If the buffer does not contain a valid date (this being an error), the member
function will set the err argument to the ios_base::failbit. But if the return value equals last, then the member function will set
ios_base::eofbit in str.







Method do_get_monthname()

Access Protected

Classification Accessor

Syntax virtual iter_type do_get_monthname(iter_type s,
iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the beginning
character of a character sequence.

end is an input iterator that points to the end
character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the month name field
is stored.

Returns This method returns an iterator that points
immediately beyond the last character of the
valid month name field.



Description



The do_get_monthname() method reads the characters from the
character sequence (s,end] until it has extracted the name of the month (perhaps an abbbreviation).
If the sequence is an abbreviation, the member function will continue to extract the
characters from the sequence until the full name is a match or it fails. If successful,
the results are stored in the appropriate member of the struct tm t argument.
If an error occurs, then err will be set to ios_base::failbit. It returns
an iterator that points immediately beyond the last character of the valid date field.







Method do_get_weekday()

Access Protected

Classification Accessor

Syntax virtual iter_type do_get_weekday(iter_type s,
iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the beginning
character of a character sequence.

end is an input iterator that points to the end
character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the weekday field
is stored.


Returns This method returns an iterator that points
immediately beyond the last character of the valid
weekday field.



Description



The do_get_weekday() method reads the characters from the
character sequence (s,end] until it has extracted the name of the weekday (perhaps an abbreviation).
If the sequence is an abbreviation, the member function will continue to extract the
characters from the sequence until the full name is a match or it fails. If successful,
the results are stored in the appropriate member of the struct tm t argument.
If an error occurs, then err will be set to ios_base::failbit. It returns
an iterator that points immediately beyond the last character of the valid weekday field.







Method do_get_time()

Access Protected

Classification Accessor

Syntax virtual iter_type do_get_time(iter_type s,
iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;


Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the time field is
stored.

Returns This method returns an iterator that points
immediately beyond the last character of the valid
time field.



Description



The do_get_time() method reads the characters from the
character sequence (s,end] until it has extracted the time field. The results are stored
in the appropriate member of the struct tm t. If an error occurs, then err will be set to
ios_base::failbit. It returns an iterator that points immediately beyond the last character
of the valid time field.







Method do_get_year()

Access Protected

Classification Accessor

Syntax virtual iter_type do_get_year(iter_type s,
iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the year field
is stored.

Returns The method returns an iterator that points
immediately beyond the last character of the valid
year field.



Description



The do_get_year() method reads the characters from the
character sequence (s,end] until it has extracted the year field. The manner in which
the year is represented is implementation-defined. The results are stored
in the appropriate member of the struct tm t. If an error occurs, then err will be set to
ios_base::failbit. It returns an iterator that points immediately beyond the last character
of the valid year field.







Method get_date()

Access Public

Classification Accessor

Syntax iter_type get_date(iter_type s, iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the date field is
stored.


Returns The method returns an iterator that points
immediately beyond the last character of the valid
date field.



Description



The get_date() method returns do_get_date(s, end, str, err, t).







Method get_weekday()

Access Public

Classification Accessor

Syntax iter_type get_weekday(iter_type s, iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the weekday field is
stored.


Returns The method returns an iterator that points
immediately beyond the last character of the valid
weekday field.



Description



The get_weekday() method returns do_get_weekday(s, end, str, err, t).







Method get_monthname()

Access Public

Classification Accessor

Syntax iter_type get_monthname(iter_type s, iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the month name field
is stored.


Returns The method returns an iterator that points
immediately beyond the last character of the valid
month name field.



Description



The get_monthname() member function returns do_get_monthname(s, end, str, err, t).







Method get_year()

Access Public

Classification Accessor

Syntax iter_type get_year(iter_type s, iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the year field is
stored.


Returns The method returns an iterator that points
immediately beyond the last character of the valid
year field.



Description



The get_year() member function returns do_get_year(s, end, str, err, t).







Method get_time()

Access Public

Classification Accessor

Syntax iter_type get_time(iter_type s, iter_type end,
ios_base& str,
ios_base::iostate& err,
tm *t) const;

Parameters s is an input iterator that points to the
beginning character of a character sequence.

end is an input iterator that points to the
end character of a character sequence.

str is the reference to the ios_base object.

err is set to ios_base::failbit when an error
occurs.

t is the struct tm in which the time field is
stored.


Returns The method returns an iterator that points
immediately beyond the last character of the valid
time field.



Description



The get_time() member function returns do_get_time(s, end, str, err, t).







Method time_get()

Access Public

Classification Constructor

Syntax explicit time_get(size_t refs = 0);

Parameters refs, if the refs argument = 0 then the destruction
of the object is delegated to the locale or locales
which contain it. If refs = 1 then the object must
be explicitly deleted. The locale will not delete
it. The object can then be maintained across the
lifetime of multiple locales.

Returns None



Description



This constructor constructs a time_get facet object.







Method time_get()

Access Protected

Classification Destructor

Syntax ~time_get();

Parameters None

Returns None



Description



This destructor destroys a time_get facet object.




The Class Relationship Diagram for time_get






No comments: