tmp/tmp4x5mv330/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### General <a id="locale.time.get.general">[[locale.time.get.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
class time_base {
|
| 6 |
+
public:
|
| 7 |
+
enum dateorder { no_order, dmy, mdy, ymd, ydm };
|
| 8 |
+
};
|
| 9 |
+
|
| 10 |
+
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 11 |
+
class time_get : public locale::facet, public time_base {
|
| 12 |
+
public:
|
| 13 |
+
using char_type = charT;
|
| 14 |
+
using iter_type = InputIterator;
|
| 15 |
+
|
| 16 |
+
explicit time_get(size_t refs = 0);
|
| 17 |
+
|
| 18 |
+
dateorder date_order() const { return do_date_order(); }
|
| 19 |
+
iter_type get_time(iter_type s, iter_type end, ios_base& f,
|
| 20 |
+
ios_base::iostate& err, tm* t) const;
|
| 21 |
+
iter_type get_date(iter_type s, iter_type end, ios_base& f,
|
| 22 |
+
ios_base::iostate& err, tm* t) const;
|
| 23 |
+
iter_type get_weekday(iter_type s, iter_type end, ios_base& f,
|
| 24 |
+
ios_base::iostate& err, tm* t) const;
|
| 25 |
+
iter_type get_monthname(iter_type s, iter_type end, ios_base& f,
|
| 26 |
+
ios_base::iostate& err, tm* t) const;
|
| 27 |
+
iter_type get_year(iter_type s, iter_type end, ios_base& f,
|
| 28 |
+
ios_base::iostate& err, tm* t) const;
|
| 29 |
+
iter_type get(iter_type s, iter_type end, ios_base& f,
|
| 30 |
+
ios_base::iostate& err, tm* t, char format, char modifier = 0) const;
|
| 31 |
+
iter_type get(iter_type s, iter_type end, ios_base& f,
|
| 32 |
+
ios_base::iostate& err, tm* t, const char_type* fmt,
|
| 33 |
+
const char_type* fmtend) const;
|
| 34 |
+
|
| 35 |
+
static locale::id id;
|
| 36 |
+
|
| 37 |
+
protected:
|
| 38 |
+
~time_get();
|
| 39 |
+
virtual dateorder do_date_order() const;
|
| 40 |
+
virtual iter_type do_get_time(iter_type s, iter_type end, ios_base&,
|
| 41 |
+
ios_base::iostate& err, tm* t) const;
|
| 42 |
+
virtual iter_type do_get_date(iter_type s, iter_type end, ios_base&,
|
| 43 |
+
ios_base::iostate& err, tm* t) const;
|
| 44 |
+
virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_base&,
|
| 45 |
+
ios_base::iostate& err, tm* t) const;
|
| 46 |
+
virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base&,
|
| 47 |
+
ios_base::iostate& err, tm* t) const;
|
| 48 |
+
virtual iter_type do_get_year(iter_type s, iter_type end, ios_base&,
|
| 49 |
+
ios_base::iostate& err, tm* t) const;
|
| 50 |
+
virtual iter_type do_get(iter_type s, iter_type end, ios_base& f,
|
| 51 |
+
ios_base::iostate& err, tm* t, char format, char modifier) const;
|
| 52 |
+
};
|
| 53 |
+
}
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
`time_get` is used to parse a character sequence, extracting components
|
| 57 |
+
of a time or date into a `tm` object. Each `get` member parses a format
|
| 58 |
+
as produced by a corresponding format specifier to `time_put<>::put`. If
|
| 59 |
+
the sequence being parsed matches the correct format, the corresponding
|
| 60 |
+
members of the `tm` argument are set to the values used to produce the
|
| 61 |
+
sequence; otherwise either an error is reported or unspecified values
|
| 62 |
+
are assigned.[^15]
|
| 63 |
+
|
| 64 |
+
If the end iterator is reached during parsing by any of the `get()`
|
| 65 |
+
member functions, the member sets `ios_base::eofbit` in `err`.
|
| 66 |
+
|