STD::TIME_PUT(3cxx)

πŸ’… std::time_put< _CharT, _OutIter > β€” manual section 3cxx, bestie πŸ’…

okay so you found the 3cxx manual page for std::time_put< _CharT, _OutIter > and honestly? iconic of you. sit down, grab a strawberry drink πŸ“, and let's get into it.


🌸 NAME

std::time_put< _CharT, _OutIter > β€” the primary class template time_put. that's it, that's the name, she's a template and she's the primary one πŸ’–


✨ SYNOPSIS

#include <locale>

Inherits std::locale::facet.

Inherited by std::time_put_byname< _CharT, _OutIter >. so she's got a whole byname daughter, main character family tree fr fr πŸ‘‘

πŸ’– Public Types

  • typedef _CharT char_type β€” public typedef, bestie. the char type. yeah.
  • typedef _OutIter iter_type β€” public typedef. the iterator type. the way that it just sits there being public? obsessed.

πŸŽ€ Public Member Functions

  • time_put (size_t __refs=0) β€” constructor, does the initialization thing. default __refs is 0, don't forget ✨
  • iter_type put (iter_type __s, ios_base &__io, char_type __fill, const tm *__tm, char __format, char __mod=0) const β€” format and output a time or date. note __mod defaults to 0 πŸŽ€
  • iter_type put (iter_type __s, ios_base &__io, char_type __fill, const tm *__tm, const _CharT *__beg, const _CharT *__end) const β€” format and output a time or date, but this time with a __beg / __end range instead of a format char. two puts, two vibes πŸ’…

πŸ¦‹ Static Public Attributes

  • static locale::id id β€” "Numpunct facet id." yes bestie that's literally what the page says, and we are NOT editing the facts. that's the label, periodt.

🧚 Protected Member Functions

  • virtual ~time_put () β€” destructor. virtual. protected. she's shy but she cleans up 🫢
  • virtual iter_type do_put (iter_type __s, ios_base &__io, char_type __fill, const tm *__tm, char __format, char __mod) const β€” format and output a time or date. this is the hook, the one the derived classes override. yes, the signature is exactly that and no, __mod has no default here πŸ™ˆ

⭐ 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)

look at the whole little static protected squad 😭 all of them listed, none of them skipped. and yes, _S_clone_c_locale and _S_get_c_name really do say throw (), we're keeping that exactly πŸ’―


πŸ”₯ Detailed Description

template<typename _CharT, typename _OutIter>
    class std::time_put< _CharT, _OutIter >

Primary class template time_put. ✨

This facet encapsulates the code to format and output dates and times according to formats used by strftime(). it's giving "I speak calendar" πŸ—“οΈ

The time_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the time_put facet. so: public face, protected brain, devs get to plug in their own behavior. slay πŸ§ πŸ’…


πŸ’œ Member Typedef Documentation

template<typename _CharT , typename _OutIter > typedef _CharT std::time_put< _CharT, _OutIter >::char_type

Public typedefs. that's the whole description. short and confident πŸŽ€

template<typename _CharT , typename _OutIter > typedef _OutIter std::time_put< _CharT, _OutIter >::iter_type

Public typedefs again. she said "I'll say it twice" and honestly? valid 🌸


🌈 Constructor & Destructor Documentation

template<typename _CharT , typename _OutIter > std::time_put< _CharT, _OutIter >::time_put (size_t __refs = 0) [inline], [explicit]

Constructor performs initialization. This is the constructor provided by the standard. no custom chaos, just the standard one, we love a compliant queen πŸ‘‘

Parameters

  • __refs β€” Passed to the base facet class.

template<typename _CharT , typename _OutIter > virtual std::time_put< _CharT, _OutIter >::~time_put () [inline], [protected], [virtual]

Destructor. three tags: [inline], [protected], [virtual]. she's leaving the party quietly πŸ¦‹


πŸ‘‘ Member Function Documentation

template<typename _CharT , typename _OutIter > _OutIter std::time_put< _CharT, _OutIter >::do_put (iter_type __s, ios_base & __io, char_type __fill, const tm * __tm, char __format, char __mod) const [protected], [virtual]

Format and output a time or date. This function formats the data in struct tm according to the provided format char and optional modifier. This function is a hook for derived classes to change the value returned.

See also: put() for more details. β€” yeah bestie, go read put(), it's right below πŸ‘€

Parameters

  • __s β€” The stream to write to.
  • __io β€” Source of locale.
  • __fill β€” char_type to use for padding.
  • __tm β€” Struct tm with date and time info to format.
  • __format β€” Format char.
  • __mod β€” Optional modifier char.

Returns: Iterator after writing.

References std::ios_base::_M_getloc(), and std::__ctype_abstract_base< _CharT >::widen(). (exact spellings, don't @ me)

Referenced by std::time_put< _CharT, _OutIter >::put().

template<typename _CharT , typename _OutIter > iter_type std::time_put< _CharT, _OutIter >::put (iter_type __s, ios_base & __io, char_type __fill, const tm * __tm, char __format, char __mod = 0) const [inline]

Format and output a time or date. This function formats the data in struct tm according to the provided format char and optional modifier. The format and modifier are interpreted as by strftime(). It does so by returning time_put::do_put(). so it's the public bestie that just forwards to the protected hook β€” delegation, we stan πŸ”₯

Parameters

  • __s β€” The stream to write to.
  • __io β€” Source of locale.
  • __fill β€” char_type to use for padding.
  • __tm β€” Struct tm with date and time info to format.
  • __format β€” Format char.
  • __mod β€” Optional modifier char.

Returns: Iterator after writing.

References std::time_put< _CharT, _OutIter >::do_put().

template<typename _CharT , typename _OutIter > _OutIter std::time_put< _CharT, _OutIter >::put (iter_type __s, ios_base & __io, char_type __fill, const tm * __tm, const _CharT * __beg, const _CharT * __end) const

Format and output a time or date. This function formats the data in struct tm according to the provided format string. The format string is interpreted as by strftime(). whole string instead of one char β€” she contains multitudes πŸ’–

Parameters

  • __s β€” The stream to write to.
  • __io β€” Source of locale.
  • __fill β€” char_type to use for padding.
  • __tm β€” Struct tm with date and time info to format.
  • __beg β€” Start of format string.
  • __end β€” End of format string.

Returns: Iterator after writing.

References std::ios_base::_M_getloc(), and std::__ctype_abstract_base< _CharT >::narrow(). (yup, narrow() this time, not widen() β€” the details MATTER)


πŸ“ Member Data Documentation

template<typename _CharT , typename _OutIter > locale::id std::time_put< _CharT, _OutIter >::id [static]

Numpunct facet id. that's what the page says, that's what I'm telling you, no notes πŸ’€ (it's locale::id, it's [static], and the description is exactly that one line.)


πŸ’« Author

Generated automatically by Doxygen for libstdc++ from the source code. not a human, just a very diligent robot doing her thing πŸ€–βœ¨


heads up bestie: everything above is quoted straight from the page's own descriptions β€” I'm not adding extra behavior lore, so if you need the deep semantics, that's strftime()'s business 🫢

and that's the whole page!! no flags skipped, no throw () quietly deleted, no missing __mod=0. you ate this one up ngl πŸ’…πŸŒˆ

β€” xoxo, your 3cxx girl: this one's from the libstdc++ source/version, auto-generated by Doxygen for libstdc++ from the source code, and signed off at the bottom of the page as libst πŸ˜­πŸ’– periodt.

πŸ“¦ where this page comes from