STD::TIME_GET_BYNAME(3)
๐ NAME ๐
std::time_get_byname< _CharT, _InIter > โ bestie, this is the class time_get_byname [22.2.5.2]. (This page lives in the Library Functions Manual, section 3, so if you're wondering where the manual name went, that's it. Hi. Welcome. ๐ซถ)
โจ SYNOPSIS โจ
#include <locale>
It inherits std::time_get< _CharT, _InIter >, so all that base-class energy comes along for the ride. ๐
๐ธ Public Types
typedef _CharT char_typeenum dateorder { no_order, dmy, mdy, ymd, ydm }typedef _InIter iter_type
๐ Public Member Functions
time_get_byname (const char *, size_t __refs=0)time_get_byname (const string &__s, size_t __refs=0)dateorder date_order () constโ gives you back the preferred order of month, day, and year ๐ซiter_type get (iter_type __s, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, char __format, char __modifier=0) constโ parses an input string according to the format you hand ititer_type get (iter_type __s, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, const char_type *__fmt, const char_type *__fmtend) constโ same vibe, also parses an input string according to formatiter_type get_date (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input date string ๐iter_type get_monthname (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input month stringiter_type get_time (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input time string โฐiter_type get_weekday (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input weekday stringiter_type get_year (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input year string
๐ง Static Public Attributes
static locale::id idโ Numpunct facet id.
๐ฎ Protected Member Functions
iter_type _M_extract_name (iter_type __beg, iter_type __end, int &__member, const _CharT **__names, size_t __indexlen, ios_base &__io, ios_base::iostate &__err) constiter_type _M_extract_num (iter_type __beg, iter_type __end, int &__member, int __min, int __max, size_t __len, ios_base &__io, ios_base::iostate &__err) constiter_type _M_extract_via_format (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, const _CharT *__format) constiter_type _M_extract_via_format (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm, const _CharT *__format, __time_get_state &__state) constiter_type _M_extract_wday_or_month (iter_type __beg, iter_type __end, int &__member, const _CharT **__names, size_t __indexlen, ios_base &__io, ios_base::iostate &__err) constvirtual dateorder do_date_order () constโ returns the preferred order of month, day, and yeariter_type do_get (iter_type __s, iter_type __end, ios_base &__f, ios_base::iostate &__err, tm *__tm, char __format, char __modifier) constโ parses an input string according to formatvirtual iter_type do_get_date (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input date stringvirtual iter_type do_get_monthname (iter_type __beg, iter_type __end, ios_base &, ios_base::iostate &__err, tm *__tm) constโ parses an input month stringvirtual iter_type do_get_time (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input time stringvirtual iter_type do_get_weekday (iter_type __beg, iter_type __end, ios_base &, ios_base::iostate &__err, tm *__tm) constโ parses an input weekday stringvirtual iter_type do_get_year (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, tm *__tm) constโ parses an input year string
๐ฆ Static Protected Member Functions
static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)static void _S_destroy_c_locale (__c_locale &__cloc)static __c_locale _S_get_c_locale ()static const char * _S_get_c_name () throw ()static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)
๐ Detailed Description ๐
template<typename _CharT, typename _InIter>
class std::time_get_byname< _CharT, _InIter >
Class time_get_byname [22.2.5.2]. That's it, that's the whole vibe check. ๐
๐ซ Member Function Documentation ๐ซ
date_order (inherited) โจ
template<typename _CharT, typename _InIter> dateorder std::time_get< _CharT, _InIter >::date_order () const [inline], [inherited]
Return preferred order of month, day, and year. This function returns an enum from time_base::dateorder, giving you the preferred ordering if the format x handed to time_put::put() only uses month, day, and year. If the format x for the associated locale uses other fields, this function returns time_base::dateorder::noorder.
NOTE: The library always returns noorder at the moment. ๐ญ (yes fr, always)
Returns
- A member of
time_base::dateorder.
References do_date_order().
do_date_order (protected, virtual, inherited) ๐
template<typename _CharT, typename _InIter>
_GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 time_base::dateorder std::time_get< _CharT, _InIter >::do_date_order () const [protected], [virtual], [inherited]
Return preferred order of month, day, and year. This function returns an enum from time_base::dateorder, giving the preferred ordering if the format x given to time_put::put() only uses month, day, and year. This function is a hook for derived classes to change the value returned. ๐ช
Returns
- A member of
time_base::dateorder.
Referenced by date_order().
do_get (inline, protected, inherited) ๐
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::do_get (iter_type __s, iter_type __end, ios_base & __f, ios_base::iostate & __err, tm * __tm, char __format, char __modifier) const [inline], [protected], [inherited]
Parse input string according to format. This function parses the string according to the provided format and optional modifier. This function is a hook for derived classes to change the value returned.
See also get() for more details.
Parameters
__sโ Start of string to parse.__endโ End of string to parse.__fโ Source of the locale.__errโ Error flags to set.__tmโ Pointer tostruct tmto fill in.__formatโ Format specifier.__modifierโ Format modifier.
Returns
- Iterator to first char not parsed.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, std::ios_base::goodbit, std::use_facet(), and std::__ctype_abstract_base< _CharT >::widen().
Referenced by get(), and get().
do_get_date (protected, virtual, inherited) ๐
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::do_get_date (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const [protected], [virtual], [inherited]
Parse input date string. This function parses a date according to the format X and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
See also get_date() for details.
Parameters
__begโ Start of string to parse.__endโ End of string to parse.__ioโ Source of the locale.__errโ Error flags to set.__tmโ Pointer tostruct tmto fill in.
Returns
- Iterator to first char beyond date string.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, and std::use_facet().
Referenced by get_date().
do_get_monthname (protected, virtual, inherited) ๐ธ
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::do_get_monthname (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const [protected], [virtual], [inherited]
Parse input month string. This function parses a month name and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
See also get_monthname() for details.
Parameters
__begโ Start of string to parse.__endโ End of string to parse.__ioโ Source of the locale.__errโ Error flags to set.__tmโ Pointer tostruct tmto fill in.
Returns
- Iterator to first char beyond month name.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, and std::use_facet().
Referenced by get_monthname().
do_get_time (protected, virtual, inherited) โฐ
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::do_get_time (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const [protected], [virtual], [inherited]
Parse input time string. This function parses a time according to the format x and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
See also get_time() for details.
Parameters
__begโ Start of string to parse.__endโ End of string to parse.__ioโ Source of the locale.__errโ Error flags to set.__tmโ Pointer tostruct tmto fill in.
Returns
- Iterator to first char beyond time string.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, and std::use_facet().
Referenced by get_time().
do_get_weekday (protected, virtual, inherited) ๐
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::do_get_weekday (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const [protected], [virtual], [inherited]
Parse input weekday string. This function parses a weekday name and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
See also get_weekday() for details.
Parameters
__begโ Start of string to parse.__endโ End of string to parse.__ioโ Source of the locale.__errโ Error flags to set.__tmโ Pointer tostruct tmto fill in.
Returns
- Iterator to first char beyond weekday name.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, and std::use_facet().
Referenced by get_weekday().
do_get_year (protected, virtual, inherited) โญ
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::do_get_year (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const [protected], [virtual], [inherited]
Parse input year string. This function reads up to 4 characters to parse a year string and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
See also get_year() for details.
Parameters
__begโ where the string we're parsing starts, bestie.__endโ where it ends.__ioโ the source of the locale, aka where the vibes come from.__errโ the error flags we're gonna set.__tmโ pointer to thestruct tmwe're filling in. ๐
Returns Iterator to first char beyond year.
References std::ios_base::_M_getloc(), std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::__ctype_abstract_base< _CharT >::narrow(), and std::use_facet().
Referenced by get_year().
the get that takes a char __format ๐
template<typename _CharT, typename _InIter> iter_type std::time_get< _CharT, _InIter >::get (iter_type __s, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm, char __format, char __modifier = 0) const
it's [inline] and [inherited], in case you were wondering ๐ซถ
okay so this one parses your input string according to a format, and literally all it does is call time_get::do_get with the params you handed it. middleman energy, but make it iconic.
See also do_get() and get().
Parameters
__sโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.__formatโ the format specifier.__modifierโ the format modifier.
Returns Iterator to first char not parsed.
References do_get().
the get with the format string ๐ธ
template<typename _CharT, typename _InIter> _InIter std::time_get< _CharT, _InIter >::get (iter_type __s, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm, const char_type * __fmt, const char_type * __fmtend) const
also [inline], also [inherited] ๐
ngl this one is the main character. It parses the input string according to a format string you provide, and it does the exact inverse of time_put::put. The format string follows the format specified for strftime(3)/strptime(3). The actual parsing? That's time_get::do_get doing the work behind the scenes.
Parameters
__sโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.__fmtโ start of the format string.__fmtendโ end of the format string.
Returns Iterator to first char not parsed.
References std::ios_base::_M_getloc(), do_get(), std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::__ctype_abstract_base< _CharT >::is(), std::__ctype_abstract_base< _CharT >::narrow(), std::__ctype_abstract_base< _CharT >::tolower(), std::__ctype_abstract_base< _CharT >::toupper(), and std::use_facet().
get_date ๐
template<typename _CharT, typename _InIter> iter_type std::time_get< _CharT, _InIter >::get_date (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const
[inline], [inherited], you know the drill โจ
parses a date string, according to format x, and drops the results into your very own user-supplied struct tm. the result comes back from calling time_get::do_get_date().
if there's a valid date string according to format x, tm gets filled in accordingly and the returned iterator points to the first character beyond the date string. if an error happens before the end, err |= ios_base::failbit. if parsing reads all the characters, err |= ios_base::eofbit.
Parameters
__begโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.
Returns Iterator to first char beyond date string.
References do_get_date().
get_monthname ๐
template<typename _CharT, typename _InIter> iter_type std::time_get< _CharT, _InIter >::get_monthname (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const
[inline], [inherited] ๐
parses a month name and puts the results into a user-supplied struct tm. the result is returned by calling time_get::do_get_monthname().
here's the tea on how parsing goes: it starts by parsing an abbreviated month name. if a valid abbreviation is followed by a character that would lead to the full month name, parsing continues until the full name is found or an error occurs. otherwise parsing finishes at the end of the abbreviated name. so like, it commits but only if you give it a reason to ๐
if an error occurs before the end, err |= ios_base::failbit. if parsing reads all the characters, err |= ios_base::eofbit.
Parameters
__begโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.
Returns Iterator to first char beyond month name.
References do_get_monthname().
get_time โฐ
template<typename _CharT, typename _InIter> iter_type std::time_get< _CharT, _InIter >::get_time (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const
[inline], [inherited] ๐ฆ
parses a time according to format X and puts the results into a user-supplied struct tm. the result is returned by calling time_get::do_get_time().
if there's a valid time string according to format X, tm gets filled in accordingly and the returned iterator points to the first character beyond the time string. if an error occurs before the end, err |= ios_base::failbit. if parsing reads all the characters, err |= ios_base::eofbit.
Parameters
__begโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.
Returns Iterator to first char beyond time string.
References do_get_time().
get_weekday ๐
template<typename _CharT, typename _InIter> iter_type std::time_get< _CharT, _InIter >::get_weekday (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const
[inline], [inherited] ๐
parses a weekday name and puts the results into a user-supplied struct tm. the result is returned by calling time_get::do_get_weekday().
same lil trick as the month one: parsing starts with the abbreviated weekday name. if a valid abbreviation is followed by a character that would lead to the full weekday name, parsing continues until the full name is found or an error occurs. otherwise parsing finishes at the end of the abbreviated name.
if an error occurs before the end, err |= ios_base::failbit. if parsing reads all the characters, err |= ios_base::eofbit.
Parameters
__begโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.
Returns Iterator to first char beyond weekday name.
References do_get_weekday().
get_year ๐๏ธ
template<typename _CharT, typename _InIter> iter_type std::time_get< _CharT, _InIter >::get_year (iter_type __beg, iter_type __end, ios_base & __io, ios_base::iostate & __err, tm * __tm) const
[inline], [inherited] โญ
this one reads up to 4 characters to parse a year string and puts the results into a user-supplied struct tm. the result is returned by calling time_get::do_get_year().
- 4 consecutive digits get interpreted as a full year.
- if there are exactly 2 consecutive digits, the library interprets this as the number of years since 1900.
if an error occurs before the end, err |= ios_base::failbit. if parsing reads all the characters, err |= ios_base::eofbit.
Parameters
__begโ start of string to parse.__endโ end of string to parse.__ioโ source of the locale.__errโ error flags to set.__tmโ pointer tostruct tmto fill in.
Returns Iterator to first char beyond year.
References do_get_year().
๐พ Member Data Documentation ๐พ
id ๐
template<typename _CharT, typename _InIter> locale::id std::time_get< _CharT, _InIter >::id
it's [static] and [inherited], no cap ๐
Numpunct facet id.
โ๏ธ Author โ๏ธ
Generated automatically by Doxygen for libstdc++ from the source code.
and that's a wrap on part 2, bestie ๐ซถ this whole thing came straight out of the libstdc++ docs โ the manpage you're holding is std::time_..., _InIter >(3), and that's the libstdc++ source/version it shipped from. go forth and parse dates, you absolute icon ๐๐
๐ฆ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 ยท GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: libstdc++-docs 14.4.1-4.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms