|
BDE 4.39.x Production Release
|
#include <bdlt_dateformatter.h>
This class provides a specifier formatter for printing Date objects.
Public Member Functions | |
| BSLS_KEYWORD_CONSTEXPR_CPP20 | DateFormatter () |
| BSLS_KEYWORD_CONSTEXPR_CPP20 void | parseDefault () |
| BSLS_KEYWORD_CONSTEXPR_CPP20 void | parseIso8601 () |
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool | parseNextModifier (StringView *specInOut) |
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool | parseNextSpecifier (bsl::basic_string_view< t_CHAR > *specInOut) |
| void | postprocess (const bslfmt::FormatSpecificationParser< t_CHAR > &spec) |
| BSLS_KEYWORD_CONSTEXPR_CPP20 int | extraSections () const |
| template<class t_ITERATOR > | |
| bool | formatNextSpecifier (bsl::basic_string_view< t_CHAR > *specInOut, t_ITERATOR *outIt, const DateFormatter_Cache &value) const |
| template<class t_ITERATOR > | |
| t_ITERATOR | formatDefault (t_ITERATOR out, const DateFormatter_Cache &value) const |
| template<class t_ITERATOR > | |
| t_ITERATOR | formatIso8601 (t_ITERATOR out, const DateFormatter_Cache &value) const |
| BSLS_KEYWORD_CONSTEXPR_CPP20 int | totalWidth (const DateFormatter_Cache &value) const |
| BSLS_KEYWORD_CONSTEXPR_CPP20 bdlt::DateFormatter< t_CHAR >::DateFormatter | ( | ) |
Create an object in its default initial state.
| BSLS_KEYWORD_CONSTEXPR_CPP20 int bdlt::DateFormatter< t_CHAR >::extraSections | ( | ) | const |
Return the bslfmt::FormatSpecificationParser::Sections flags that apply to this value type.
|
inline |
Format the specified value to the specified out using the default format and return out.
|
inline |
Format the specified value to the specified out using the Iso8601 format and return out.
| bool bdlt::DateFormatter< t_CHAR >::formatNextSpecifier | ( | bsl::basic_string_view< t_CHAR > * | specInOut, |
| t_ITERATOR * | outIt, | ||
| const DateFormatter_Cache & | value | ||
| ) | const |
If the first character of the specified *specInOut is recognized by this specifier formatter, use it to format the specified value to *outIt, remove the character from *specInOut, and return true, otherwise return false with no modification to *specInOut.
| BSLS_KEYWORD_CONSTEXPR_CPP20 void bdlt::DateFormatter< t_CHAR >::parseDefault | ( | ) |
Update this object as-if parsing Date in default mode.
| BSLS_KEYWORD_CONSTEXPR_CPP20 void bdlt::DateFormatter< t_CHAR >::parseIso8601 | ( | ) |
Update this object as-if parsing Date in Iso8601 mode.
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool bdlt::DateFormatter< t_CHAR >::parseNextModifier | ( | StringView * | specInOut | ) |
Examine the first character of the specified *specInOut and if it is recognized as a modifier by this object, update this object's state to reflect it and pop it off the front of *specInOut and return true, and if not, return false with no modification to *specInOut.
| BSLS_KEYWORD_CONSTEXPR_CPP20 bool bdlt::DateFormatter< t_CHAR >::parseNextSpecifier | ( | bsl::basic_string_view< t_CHAR > * | specInOut | ) |
If the first character of the specified *specInOut is recognized by this specifier formatter, parse it, remove it from *specInOut, and return true, otherwise return false with no modification to *specInOut.
*specInOut is empty.
|
inline |
Read post-processed fields from the specified spec that are relevant to this specifier formatter.
| BSLS_KEYWORD_CONSTEXPR_CPP20 int bdlt::DateFormatter< t_CHAR >::totalWidth | ( | const DateFormatter_Cache & | value | ) | const |
Return the anticipated width of output given all the parse* calls that have been happened thus far and the specified value.