Date and time part formatter interface.
More...
#include <iDatePartFormatter.hpp>
Date and time part formatter interface.
Implement this interface to add a pattern to DateFormatter (DateFormatter::registerFormatterPart ): parts format and parse the broken down local time ( DateFields , computed once by DateFormatter ).
A part has a fixed size: setValue receives exactly getSize characters. When a DateTime is parsed, its fields are 1970-01-01 00:00:00.000 before parts are called, and the point in time is built afterwards.
- Author
- Vincent Lachenal
◆ ~IDatePartFormatter()
| virtual anch::date::IDatePartFormatter::~IDatePartFormatter |
( |
| ) |
|
|
inlinevirtual |
◆ format()
| virtual void anch::date::IDatePartFormatter::format |
( |
const anch::date::DateFields & | fields, |
|
|
std::ostream & | output ) const |
|
pure virtualnoexcept |
Format date
- Parameters
-
| fields | the local time of the DateTime to format |
| output | The output stream to write in |
◆ getPattern()
| virtual const std::string & anch::date::IDatePartFormatter::getPattern |
( |
| ) |
const |
|
pure virtualnoexcept |
Get formatter part pattern
- Returns
- The formatter part pattern
◆ getSize()
| virtual std::size_t anch::date::IDatePartFormatter::getSize |
( |
| ) |
const |
|
pure virtualnoexcept |
Get size of formatter part
- Returns
- The size of formatter part
◆ setValue()
| virtual bool anch::date::IDatePartFormatter::setValue |
( |
anch::date::DateFields & | fields, |
|
|
const std::string & | value ) const |
|
pure virtualnoexcept |
Set parsed value
- Parameters
-
| fields | the local time to modify |
| value | The value to set |
- Returns
true when value is valid, false otherwise
The documentation for this class was generated from the following file: