std::time_put<CharT,OutputIt>::put,std::time_put<CharT,OutputIt>::do_put (3) - Linux Manuals
std::time_put<CharT,OutputIt>::put,std::time_put<CharT,OutputIt>::do_put: std::time_put<CharT,OutputIt>::put,std::time_put<CharT,OutputIt>::do_put
NAME
std::time_put<CharT,OutputIt>::put,std::time_put<CharT,OutputIt>::do_put - std::time_put<CharT,OutputIt>::put,std::time_put<CharT,OutputIt>::do_put
Synopsis
Defined in header <locale>
public:
iter_type put( iter_type out, std::ios_base& str, (1)
char_type fill, const std::tm* t,
const CharT* fmtbeg, const CharT* fmtend ) const;
public:
iter_type put( iter_type out, std::ios_base& str, (2)
char_type fill, const std::tm* t,
char format, char modifier = 0 ) const;
protected:
virtual iter_type do_put( iter_type out, std::ios_base& str, (3)
char_type fill, const std::tm* t,
char format, char modifier ) const;
Converts the calendar date and time stored in the std::tm object pointed to by t into a character string, according to the format string [fmtbeg, fmtend). The format string is the same as used by std::srtftime, but each format specifier is processed by an individual call to do_put(), which can be customized by extending this facet.
1) Steps through the character sequence [fmtbeg, fmtend), examining the characters. Every character that is not a part of a format sequence is written to the output iterator out immediately. To identify format sequences, this function narrows the next character c in [fmtbeg, fmtend) as if by std::ctype<char_type>(str.getloc()).narrow(c,0) and if it equals '%', the next one or two characters are compared to the list of format sequences recognized by std::strftime plus any additional implementation-defined formats supported by this locale. For each valid format sequence, a call to do_put(out, str, fill, t, format, modifier) is made, where format is the format sequence character, and modifier is the optional format sequence modifier ('E' or 'O'). A value of '\0' is used if the modifier is absent.
2) Calls the do_put member function of the most derived class.
3) Converts the calendar date and time stored in the std::tm object pointed to by t into a character string, according to the format conversion sequence formed by concatenating '%', the value of modifier if not '\0', and the value of format. The format is interpreted the same way as the function std::strftime, except that the formats that are described as locale-dependent are defined by this locale, and additional format specifiers may be supported (the fill argument is provided for these implementation-defined format specifiers to use). The string is written to the output iterator out.
Parameters
out - output iterator where the result of the conversion is written
str - a stream object that this function uses to obtain locale facets when needed, e.g. std::ctype to narrow characters
t - pointer to the std::tm object from which the date/time values are obtained