Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QT_BEGIN_NAMESPACE::TemporalFieldMatcher Class Reference
Collaboration diagram for QT_BEGIN_NAMESPACE::TemporalFieldMatcher:

Public Member Functions

 TemporalFieldMatcher (const QLocale &loc, QCalendar cal, std::optional< int > centuryStart)
std::vector< PartialParsecontinuations (const PartialParse &base, QStringView text, const TemporalField &field) const
bool isSelfConsistent (const PartialParse &parsed, TemporalFieldCategory category) const
bool resolve (PartialParse &parsed) const
 TemporalFieldMatcher (const QLocale &loc, QCalendar cal, std::optional< int > centuryStart)
std::vector< PartialParsecontinuations (const PartialParse &base, QStringView text, const TemporalField &field) const
bool isSelfConsistent (const PartialParse &parsed, TemporalFieldCategory category) const
bool resolve (PartialParse &parsed) const

Detailed Description

Definition at line 267 of file qtparsetemporal.cpp.

Constructor & Destructor Documentation

◆ TemporalFieldMatcher() [1/2]

QT_BEGIN_NAMESPACE::TemporalFieldMatcher::TemporalFieldMatcher ( const QLocale & loc,
QCalendar cal,
std::optional< int > centuryStart )
inline

Definition at line 317 of file qtparsetemporal.cpp.

References TemporalFieldMatcher().

Referenced by TemporalFieldMatcher().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TemporalFieldMatcher() [2/2]

QT_BEGIN_NAMESPACE::TemporalFieldMatcher::TemporalFieldMatcher ( const QLocale & loc,
QCalendar cal,
std::optional< int > centuryStart )
inline

Definition at line 317 of file qtparsetemporal.cpp.

Member Function Documentation

◆ continuations() [1/2]

std::vector< PartialParse > QT_BEGIN_NAMESPACE::TemporalFieldMatcher::continuations ( const PartialParse & base,
QStringView text,
const TemporalField & field ) const

Find all matches to field, within text, that extend base.

Each match must begin at offset {base.results.endIndex} within text. For each match, update a copy of base with the match's result, to include in the returned list.

May use calendar to determine the range of values allowed for field. Does not attempt to determine consistency between fields; see resolve() and isSelfConsistent() for that. Updates the copy's member holding the value described by field to reflect the match.

Ignores base.result.startIndex and base.result.bounds and updates each copy's .endIndex to reflect the end of the match. (This leaves the caller to decide whether to transfer that to .bounds.)

For fields that allow space padding, this consumes leading space as necessary to make a match and includes a match for each end position at which it could end; before any dangling space and after each space that follows. Later calls to continuations() shall filter out any earlier matches that precludes later fields matching just after its end. Successive space-padded fields surrounded by large amounts of space are apt to lead to many matches, as are final space-padded fields followed by large amounts of space. (TODO: we can almost certainly mitigate this with a trivial heuristic, once everything is working.)

For those matches with various flaws, relative to the field specification (such as using zero padding when not obliged to), the copy's .wanton records that flaw.

Sort order of the returned list should put entries likely to represent more suitable matches (ignoring .wanton complications) earlier. For most fields, that means longer matches come first. (For full year field matches with > 4 digits, though, that reverses.)

Definition at line 758 of file qtparsetemporal.cpp.

References QT_BEGIN_NAMESPACE::longerEarlier(), and QT_BEGIN_NAMESPACE::PartialParse::periodInDay.

Here is the call graph for this function:

◆ continuations() [2/2]

std::vector< PartialParse > QT_BEGIN_NAMESPACE::TemporalFieldMatcher::continuations ( const PartialParse & base,
QStringView text,
const TemporalField & field ) const

◆ isSelfConsistent() [1/2]

bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::isSelfConsistent ( const PartialParse & parsed,
TemporalFieldCategory category ) const

◆ isSelfConsistent() [2/2]

bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::isSelfConsistent ( const PartialParse & parsed,
TemporalFieldCategory category ) const

◆ resolve() [1/2]

◆ resolve() [2/2]

bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::resolve ( PartialParse & parsed) const

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