Files
2025-10-25 03:02:53 +03:00

5.7 KiB
Raw Permalink Blame History

[locale.time.get.members]

28 Text processing library [text]

28.3 Localization library [localization]

28.3.4 Standard locale categories [locale.categories]

28.3.4.6 The time category [category.time]

28.3.4.6.2 Class template time_get [locale.time.get]

28.3.4.6.2.2 Members [locale.time.get.members]

🔗

dateorder date_order() const;

1

#

Returns: do_date_order().

🔗

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

2

#

Returns: do_get_time(s, end, str, err, t).

🔗

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

3

#

Returns: do_get_date(s, end, str, err, t).

🔗

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

4

#

Returns: do_get_weekday(s, end, str, err, t) ordo_get_monthname(s, end, str, err, t).

🔗

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

5

#

Returns: do_get_year(s, end, str, err, t).

🔗

iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t, char format, char modifier = 0) const;

6

#

Returns: do_get(s, end, f, err, t, format, modifier).

🔗

iter_type get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm* t, const char_type* fmt, const char_type* fmtend) const;

7

#

Preconditions: [fmt, fmtend) is a valid range.

8

#

Effects: The function starts by evaluating err = ios_base::goodbit.

It then enters a loop, reading zero or more characters from s at each iteration.

Unless otherwise specified below, the loop terminates when the first of the following conditions holds:

  • (8.1)

    The expression fmt == fmtend evaluates to true.

  • (8.2)

    The expression err == ios_base::goodbit evaluates to false.

  • (8.3)

    The expression s == end evaluates to true, in which case the function evaluates err = ios_base::eofbit | ios_base::failbit.

  • (8.4)

    The next element of fmt is equal to '%', optionally followed by a modifier character, followed by a conversion specifier character, format, together forming a conversion specification valid for the POSIX function strptime. If the number of elements in the range [fmt, fmtend) is not sufficient to unambiguously determine whether the conversion specification is complete and valid, the function evaluates err = ios_base::failbit. Otherwise, the function evaluates s = do_get(s, end, f, err, t, format, modifier), where the value of modifier is '\0' when the optional modifier is absent from the conversion specification. If err == ios_base::goodbit holds after the evaluation of the expression, the function increments fmt to point just past the end of the conversion specification and continues looping.

  • (8.5)

    The expression isspace(*fmt, f.getloc()) evaluates to true, in which case the function first increments fmt untilfmt == fmtend || !isspace(*fmt, f.getloc()) evaluates to true, then advances s until s == end || !isspace(*s, f.getloc()) is true, and finally resumes looping.

  • (8.6)

    The next character read from s matches the element pointed to by fmt in a case-insensitive comparison, in which case the function evaluates ++fmt, ++s and continues looping. Otherwise, the function evaluates err = ios_base::failbit.

9

#

[Note 1:

The function uses the ctype facet installed in f's locale to determine valid whitespace characters.

It is unspecified by what means the function performs case-insensitive comparison or whether multi-character sequences are considered while doing so.

— end note]

10

#

Returns: s.