tmp/tmpadb0eodg/{from.md → to.md}
RENAMED
|
@@ -2,14 +2,13 @@
|
|
| 2 |
|
| 3 |
Templates `time_get<charT, InputIterator>` and
|
| 4 |
`time_put<charT, OutputIterator>` provide date and time formatting and
|
| 5 |
parsing. All specifications of member functions for `time_put` and
|
| 6 |
`time_get` in the subclauses of [[category.time]] only apply to the
|
| 7 |
-
specializations required in Tables [[tab:
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
`ios_base::iostate&`, and `fill` arguments as described in
|
| 11 |
[[locale.categories]], and the `ctype<>` facet, to determine formatting
|
| 12 |
details.
|
| 13 |
|
| 14 |
#### Class template `time_get` <a id="locale.time.get">[[locale.time.get]]</a>
|
| 15 |
|
|
@@ -77,11 +76,11 @@ produce the sequence; otherwise either an error is reported or
|
|
| 77 |
unspecified values are assigned.[^15]
|
| 78 |
|
| 79 |
If the end iterator is reached during parsing by any of the `get()`
|
| 80 |
member functions, the member sets `ios_base::eofbit` in `err`.
|
| 81 |
|
| 82 |
-
#####
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
dateorder date_order() const;
|
| 86 |
```
|
| 87 |
|
|
@@ -128,11 +127,11 @@ iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err,
|
|
| 128 |
``` cpp
|
| 129 |
iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err,
|
| 130 |
tm* t, const char_type* fmt, const char_type* fmtend) const;
|
| 131 |
```
|
| 132 |
|
| 133 |
-
*
|
| 134 |
|
| 135 |
*Effects:* The function starts by evaluating `err = ios_base::goodbit`.
|
| 136 |
It then enters a loop, reading zero or more characters from `s` at each
|
| 137 |
iteration. Unless otherwise specified below, the loop terminates when
|
| 138 |
the first of the following conditions holds:
|
|
@@ -170,11 +169,11 @@ by what means the function performs case-insensitive comparison or
|
|
| 170 |
whether multi-character sequences are considered while doing
|
| 171 |
so. — *end note*]
|
| 172 |
|
| 173 |
*Returns:* `s`.
|
| 174 |
|
| 175 |
-
#####
|
| 176 |
|
| 177 |
``` cpp
|
| 178 |
dateorder do_date_order() const;
|
| 179 |
```
|
| 180 |
|
|
@@ -204,14 +203,13 @@ iter_type do_get_date(iter_type s, iter_type end, ios_base& str,
|
|
| 204 |
|
| 205 |
*Effects:* Reads characters starting at `s` until it has extracted those
|
| 206 |
`struct tm` members and remaining format characters used by
|
| 207 |
`time_put<>::put` to produce one of the following formats, or until it
|
| 208 |
encounters an error. The format depends on the value returned by
|
| 209 |
-
`date_order()` as shown in
|
| 210 |
-
Table [[tab:lib.locale.time.get.virtuals.dogetdate]].
|
| 211 |
|
| 212 |
-
**Table: `do_get_date` effects** <a id="
|
| 213 |
|
| 214 |
| `date_order()` | Format |
|
| 215 |
| -------------- | ---------- |
|
| 216 |
| `no_order` | `"%m%d%y"` |
|
| 217 |
| `dmy` | `"%d%m%y"` |
|
|
@@ -258,11 +256,11 @@ recognized as part of a valid year identifier.
|
|
| 258 |
``` cpp
|
| 259 |
iter_type do_get(iter_type s, iter_type end, ios_base& f,
|
| 260 |
ios_base::iostate& err, tm* t, char format, char modifier) const;
|
| 261 |
```
|
| 262 |
|
| 263 |
-
*
|
| 264 |
|
| 265 |
*Effects:* The function starts by evaluating `err = ios_base::goodbit`.
|
| 266 |
It then reads characters starting at `s` until it encounters an error,
|
| 267 |
or until it has extracted and assigned those `struct tm` members, and
|
| 268 |
any remaining format characters, corresponding to a conversion directive
|
|
@@ -282,11 +280,11 @@ members from the input sequence \[`s`, `end`), it evaluates
|
|
| 282 |
members are unspecified and may be outside their valid range.
|
| 283 |
|
| 284 |
*Remarks:* It is unspecified whether multiple calls to `do_get()` with
|
| 285 |
the address of the same `struct tm` object will update the current
|
| 286 |
contents of the object or simply overwrite its members. Portable
|
| 287 |
-
programs
|
| 288 |
|
| 289 |
*Returns:* An iterator pointing immediately beyond the last character
|
| 290 |
recognized as possibly part of a valid input sequence for the given
|
| 291 |
`format` and `modifier`.
|
| 292 |
|
|
@@ -300,10 +298,11 @@ namespace std {
|
|
| 300 |
using dateorder = time_base::dateorder;
|
| 301 |
using iter_type = InputIterator;
|
| 302 |
|
| 303 |
explicit time_get_byname(const char*, size_t refs = 0);
|
| 304 |
explicit time_get_byname(const string&, size_t refs = 0);
|
|
|
|
| 305 |
protected:
|
| 306 |
~time_get_byname();
|
| 307 |
};
|
| 308 |
}
|
| 309 |
```
|
|
@@ -334,11 +333,11 @@ namespace std {
|
|
| 334 |
char format, char modifier) const;
|
| 335 |
};
|
| 336 |
}
|
| 337 |
```
|
| 338 |
|
| 339 |
-
#####
|
| 340 |
|
| 341 |
``` cpp
|
| 342 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
| 343 |
const charT* pattern, const charT* pat_end) const;
|
| 344 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
|
@@ -367,11 +366,11 @@ implementation-defined formats or by derivations. A space character is a
|
|
| 367 |
reasonable default for this argument. — *end note*]
|
| 368 |
|
| 369 |
*Returns:* An iterator pointing immediately after the last character
|
| 370 |
produced.
|
| 371 |
|
| 372 |
-
#####
|
| 373 |
|
| 374 |
``` cpp
|
| 375 |
iter_type do_put(iter_type s, ios_base&, char_type fill, const tm* t,
|
| 376 |
char format, char modifier) const;
|
| 377 |
```
|
|
@@ -394,18 +393,18 @@ reasonable default for this argument. — *end note*]
|
|
| 394 |
#### Class template `time_put_byname` <a id="locale.time.put.byname">[[locale.time.put.byname]]</a>
|
| 395 |
|
| 396 |
``` cpp
|
| 397 |
namespace std {
|
| 398 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 399 |
-
|
| 400 |
-
{
|
| 401 |
public:
|
| 402 |
using char_type = charT;
|
| 403 |
using iter_type = OutputIterator;
|
| 404 |
|
| 405 |
explicit time_put_byname(const char*, size_t refs = 0);
|
| 406 |
explicit time_put_byname(const string&, size_t refs = 0);
|
|
|
|
| 407 |
protected:
|
| 408 |
~time_put_byname();
|
| 409 |
};
|
| 410 |
}
|
| 411 |
```
|
|
|
|
| 2 |
|
| 3 |
Templates `time_get<charT, InputIterator>` and
|
| 4 |
`time_put<charT, OutputIterator>` provide date and time formatting and
|
| 5 |
parsing. All specifications of member functions for `time_put` and
|
| 6 |
`time_get` in the subclauses of [[category.time]] only apply to the
|
| 7 |
+
specializations required in Tables [[tab:locale.category.facets]] and
|
| 8 |
+
[[tab:locale.spec]] [[locale.category]]. Their members use their
|
| 9 |
+
`ios_base&`, `ios_base::iostate&`, and `fill` arguments as described in
|
|
|
|
| 10 |
[[locale.categories]], and the `ctype<>` facet, to determine formatting
|
| 11 |
details.
|
| 12 |
|
| 13 |
#### Class template `time_get` <a id="locale.time.get">[[locale.time.get]]</a>
|
| 14 |
|
|
|
|
| 76 |
unspecified values are assigned.[^15]
|
| 77 |
|
| 78 |
If the end iterator is reached during parsing by any of the `get()`
|
| 79 |
member functions, the member sets `ios_base::eofbit` in `err`.
|
| 80 |
|
| 81 |
+
##### Members <a id="locale.time.get.members">[[locale.time.get.members]]</a>
|
| 82 |
|
| 83 |
``` cpp
|
| 84 |
dateorder date_order() const;
|
| 85 |
```
|
| 86 |
|
|
|
|
| 127 |
``` cpp
|
| 128 |
iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err,
|
| 129 |
tm* t, const char_type* fmt, const char_type* fmtend) const;
|
| 130 |
```
|
| 131 |
|
| 132 |
+
*Preconditions:* \[`fmt`, `fmtend`) is a valid range.
|
| 133 |
|
| 134 |
*Effects:* The function starts by evaluating `err = ios_base::goodbit`.
|
| 135 |
It then enters a loop, reading zero or more characters from `s` at each
|
| 136 |
iteration. Unless otherwise specified below, the loop terminates when
|
| 137 |
the first of the following conditions holds:
|
|
|
|
| 169 |
whether multi-character sequences are considered while doing
|
| 170 |
so. — *end note*]
|
| 171 |
|
| 172 |
*Returns:* `s`.
|
| 173 |
|
| 174 |
+
##### Virtual functions <a id="locale.time.get.virtuals">[[locale.time.get.virtuals]]</a>
|
| 175 |
|
| 176 |
``` cpp
|
| 177 |
dateorder do_date_order() const;
|
| 178 |
```
|
| 179 |
|
|
|
|
| 203 |
|
| 204 |
*Effects:* Reads characters starting at `s` until it has extracted those
|
| 205 |
`struct tm` members and remaining format characters used by
|
| 206 |
`time_put<>::put` to produce one of the following formats, or until it
|
| 207 |
encounters an error. The format depends on the value returned by
|
| 208 |
+
`date_order()` as shown in [[locale.time.get.dogetdate]].
|
|
|
|
| 209 |
|
| 210 |
+
**Table: `do_get_date` effects** <a id="locale.time.get.dogetdate">[locale.time.get.dogetdate]</a>
|
| 211 |
|
| 212 |
| `date_order()` | Format |
|
| 213 |
| -------------- | ---------- |
|
| 214 |
| `no_order` | `"%m%d%y"` |
|
| 215 |
| `dmy` | `"%d%m%y"` |
|
|
|
|
| 256 |
``` cpp
|
| 257 |
iter_type do_get(iter_type s, iter_type end, ios_base& f,
|
| 258 |
ios_base::iostate& err, tm* t, char format, char modifier) const;
|
| 259 |
```
|
| 260 |
|
| 261 |
+
*Preconditions:* `t` points to an object.
|
| 262 |
|
| 263 |
*Effects:* The function starts by evaluating `err = ios_base::goodbit`.
|
| 264 |
It then reads characters starting at `s` until it encounters an error,
|
| 265 |
or until it has extracted and assigned those `struct tm` members, and
|
| 266 |
any remaining format characters, corresponding to a conversion directive
|
|
|
|
| 280 |
members are unspecified and may be outside their valid range.
|
| 281 |
|
| 282 |
*Remarks:* It is unspecified whether multiple calls to `do_get()` with
|
| 283 |
the address of the same `struct tm` object will update the current
|
| 284 |
contents of the object or simply overwrite its members. Portable
|
| 285 |
+
programs should zero out the object before invoking the function.
|
| 286 |
|
| 287 |
*Returns:* An iterator pointing immediately beyond the last character
|
| 288 |
recognized as possibly part of a valid input sequence for the given
|
| 289 |
`format` and `modifier`.
|
| 290 |
|
|
|
|
| 298 |
using dateorder = time_base::dateorder;
|
| 299 |
using iter_type = InputIterator;
|
| 300 |
|
| 301 |
explicit time_get_byname(const char*, size_t refs = 0);
|
| 302 |
explicit time_get_byname(const string&, size_t refs = 0);
|
| 303 |
+
|
| 304 |
protected:
|
| 305 |
~time_get_byname();
|
| 306 |
};
|
| 307 |
}
|
| 308 |
```
|
|
|
|
| 333 |
char format, char modifier) const;
|
| 334 |
};
|
| 335 |
}
|
| 336 |
```
|
| 337 |
|
| 338 |
+
##### Members <a id="locale.time.put.members">[[locale.time.put.members]]</a>
|
| 339 |
|
| 340 |
``` cpp
|
| 341 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
| 342 |
const charT* pattern, const charT* pat_end) const;
|
| 343 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
|
|
|
| 366 |
reasonable default for this argument. — *end note*]
|
| 367 |
|
| 368 |
*Returns:* An iterator pointing immediately after the last character
|
| 369 |
produced.
|
| 370 |
|
| 371 |
+
##### Virtual functions <a id="locale.time.put.virtuals">[[locale.time.put.virtuals]]</a>
|
| 372 |
|
| 373 |
``` cpp
|
| 374 |
iter_type do_put(iter_type s, ios_base&, char_type fill, const tm* t,
|
| 375 |
char format, char modifier) const;
|
| 376 |
```
|
|
|
|
| 393 |
#### Class template `time_put_byname` <a id="locale.time.put.byname">[[locale.time.put.byname]]</a>
|
| 394 |
|
| 395 |
``` cpp
|
| 396 |
namespace std {
|
| 397 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 398 |
+
class time_put_byname : public time_put<charT, OutputIterator> {
|
|
|
|
| 399 |
public:
|
| 400 |
using char_type = charT;
|
| 401 |
using iter_type = OutputIterator;
|
| 402 |
|
| 403 |
explicit time_put_byname(const char*, size_t refs = 0);
|
| 404 |
explicit time_put_byname(const string&, size_t refs = 0);
|
| 405 |
+
|
| 406 |
protected:
|
| 407 |
~time_put_byname();
|
| 408 |
};
|
| 409 |
}
|
| 410 |
```
|