AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::date::IDatePartFormatter Class Referenceabstract

Date and time part formatter interface. More...

#include <iDatePartFormatter.hpp>

Collaboration diagram for anch::date::IDatePartFormatter:

Public Member Functions

virtual ~IDatePartFormatter ()
virtual void format (const anch::date::DateFields &fields, std::ostream &output) const noexcept=0
virtual std::size_t getSize () const noexcept=0
virtual bool setValue (anch::date::DateFields &fields, const std::string &value) const noexcept=0
virtual const std::string & getPattern () const noexcept=0

Detailed Description

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

Constructor & Destructor Documentation

◆ ~IDatePartFormatter()

virtual anch::date::IDatePartFormatter::~IDatePartFormatter ( )
inlinevirtual

IDatePartFormatter destructor

Member Function Documentation

◆ format()

virtual void anch::date::IDatePartFormatter::format ( const anch::date::DateFields & fields,
std::ostream & output ) const
pure virtualnoexcept

Format date

Parameters
fieldsthe local time of the DateTime to format
outputThe 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
Here is the call graph for this function:

◆ 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
fieldsthe local time to modify
valueThe value to set
Returns
true when value is valid, false otherwise
Here is the call graph for this function:

The documentation for this class was generated from the following file: