📄 timeget.htm
字号:
<html>
<head>
<title>time_get</title>
<head>
<body bgcolor="#FFFFFF">
<a name="here"></a>
<img src="timeban.gif">
<pre>
<font size=5>Class Name</font> time_get
<font size=5>Header File</font> <locale>
<font size=5>Classification</font> abstract data type
</pre>
<a href="timeget.htm#crd">Class Relationship Diagram</a><br>
<br>
<a href="timeget.htm#class-descrip">Class Description</a>
<h1>Member Classes</h1>
<a href="timeget.htm#id">locale::id</a>
<h1>Methods</h1>
<pre>
<a href="timeget.htm#date-order">
dateorder date_order() const;</a>
<a href="timeget.htm#do-date-order">
virtual dateorder do_date_order() const;</a>
<a href="timeget.htm#do-get-date">
virtual iter_type do_get_date(iter_type s, iter_type end, ios_base&,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#do-get-monthname">
virtual iter_type do_get_monthname(iter_type s, ios_base&,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#do-get-time">
virtual iter_type do_get_time(iter_type s, iter_type end,
ios_base&, ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#do-get-weekday">
virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_base&,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#do-get-year">
virtual iter_type do_get_year(iter_type s, iter_type end, ios_base&,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#get-date">
iter_type get_date(iter_type s, iter_type end, ios_base& f,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#get-monthname">
iter_type get_monthname(iter_type s, iter_type end, ios_base& f,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#get-time">
iter_type get_time(iter_type s, iter_type end, ios_base& f,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#get-weekday">
iter_type get_weekday(iter_type s, iter_type end, ios_base& f,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#get-year">
iter_type get_year(iter_type s, iter_type end, ios_base& f,
ios_base::iostate& err, tm* t) const;</a>
<a href="timeget.htm#time-get">
explicit time_get(size_t refs = 0);</a>
<a href="timeget.htm#~time-get">
~time_get();</a>
</pre>
<hr>
<a name="class-descrip"><h3>Class Description</h3></a>
<p>
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.
</p>
<hr>
<a name="id"><h3>locale::id</h3></a>
<p>
<em>locale::id</em> is a class used to provide an identification of a locale facet interfaces used as
an index for lookup and to encapsulate initialization.
</p>
<hr>
<pre>
<a name="date-order">
Method date_order()</a>
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.
</pre>
<h3>Description</h3>
<p>
The date_order() member function returns do_date_order().
</p>
<hr>
<pre>
<a name="do-date-order">
Method do_date_order()</a>
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.
</pre>
<h3>Description</h3>
<p>
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).
</p>
<hr>
<pre>
<a name="do-get-date">
Method do_get_date()</a>
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 <em>s</em> is an input iterator that points to the beginning
character of a character sequence.
<em>end</em> is an input iterator that points to the end
character of a character sequence.
<em>str</em> is the reference to the ios_base object.
<em>err</em> is set to ios_base::failbit when an error
occurs.
<em>t</em> 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.
</pre>
<h3>Description</h3>
<p>
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 <em>tm</em> 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 <em>tm</em>. 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 <em>err</em> argument to the ios_base::failbit. But if the return value equals last, then the member function will set
ios_base::eofbit in <em>str</em>.
</p>
<hr>
<pre>
<a name="do-get-monthname">
Method do_get_monthname()</a>
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 <em>s</em> is an input iterator that points to the beginning
character of a character sequence.
<em>end</em> is an input iterator that points to the end
character of a character sequence.
<em>str</em> is the reference to the ios_base object.
<em>err</em> is set to ios_base::failbit when an error
occurs.
<em>t</em> 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.
</pre>
<h3>Description</h3>
<p>
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 <em>tm t</em> argument.
If an error occurs, then <em>err</em> will be set to ios_base::failbit. It returns
an iterator that points immediately beyond the last character of the valid date field.
</p>
<hr>
<pre>
<a name="do-get-weekday">
Method do_get_weekday()</a>
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 <em>s</em> is an input iterator that points to the beginning
character of a character sequence.
<em>end</em> is an input iterator that points to the end
character of a character sequence.
<em>str</em> is the reference to the ios_base object.
<em>err</em> is set to ios_base::failbit when an error
occurs.
<em>t</em> 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.
</pre>
<h3>Description</h3>
<p>
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 <em>tm t</em> argument.
If an error occurs, then <em>err</em> will be set to ios_base::failbit. It returns
an iterator that points immediately beyond the last character of the valid weekday field.
</p>
<hr>
<pre>
<a name="do-get-time">
Method do_get_time()</a>
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 <em>s</em> is an input iterator that points to the
beginning character of a character sequence.
<em>end</em> is an input iterator that points to the
end character of a character sequence.
<em>str</em> is the reference to the ios_base object.
<em>err</em> is set to ios_base::failbit when an error
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -