morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::table::IsoDateParser Class Referencefinal

The default date parser: ISO 8601 only, whatever the format. More...

#include <data_source.hpp>

Inheritance diagram for morph::table::IsoDateParser:
morph::table::DateParser

Public Member Functions

std::optional< std::int64_t > parseDate (std::string_view text, std::string_view format) const override
 Parses YYYY-MM-DD.
std::optional< std::int64_t > parseDateTime (std::string_view text, std::string_view format) const override
 Parses an ISO 8601 date-time, or a bare date as midnight UTC.
Public Member Functions inherited from morph::table::DateParser
virtual std::shared_ptr< DateParser const > cloneForTask () const
 An instance for one task to use alone.

Detailed Description

The default date parser: ISO 8601 only, whatever the format.

A date is YYYY-MM-DD. A date-time is what morph::time::DateTime::fromIso8601 reads, or a bare date, which is midnight UTC. Stateless and safe to call concurrently.

Definition at line 322 of file data_source.hpp.

Member Function Documentation

◆ parseDate()

std::optional< std::int64_t > morph::table::IsoDateParser::parseDate ( std::string_view text,
std::string_view format ) const
inlinenodiscardoverridevirtual

Parses YYYY-MM-DD.

Parameters
textThe text.
formatIgnored.
Returns
Days since 1970-01-01, or nothing.

Implements morph::table::DateParser.

Definition at line 329 of file data_source.hpp.

◆ parseDateTime()

std::optional< std::int64_t > morph::table::IsoDateParser::parseDateTime ( std::string_view text,
std::string_view format ) const
inlinenodiscardoverridevirtual

Parses an ISO 8601 date-time, or a bare date as midnight UTC.

Parameters
textThe text.
formatIgnored.
Returns
UTC seconds since the epoch, or nothing.

Implements morph::table::DateParser.

Definition at line 364 of file data_source.hpp.


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