![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Public Member Functions | |
| TemporalFieldMatcher (const QLocale &loc, QCalendar cal, std::optional< int > centuryStart) | |
| std::vector< PartialParse > | continuations (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< PartialParse > | continuations (const PartialParse &base, QStringView text, const TemporalField &field) const |
| bool | isSelfConsistent (const PartialParse &parsed, TemporalFieldCategory category) const |
| bool | resolve (PartialParse &parsed) const |
Definition at line 267 of file qtparsetemporal.cpp.
|
inline |
Definition at line 317 of file qtparsetemporal.cpp.
References TemporalFieldMatcher().
Referenced by TemporalFieldMatcher().
|
inline |
Definition at line 317 of file qtparsetemporal.cpp.
| 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.
| std::vector< PartialParse > QT_BEGIN_NAMESPACE::TemporalFieldMatcher::continuations | ( | const PartialParse & | base, |
| QStringView | text, | ||
| const TemporalField & | field ) const |
| bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::isSelfConsistent | ( | const PartialParse & | parsed, |
| TemporalFieldCategory | category ) const |
Definition at line 327 of file qtparsetemporal.cpp.
References QT_BEGIN_NAMESPACE::PartialParse::hourMod12, QT_BEGIN_NAMESPACE::PartialParse::periodInDay, and QT_BEGIN_NAMESPACE::PartialParse::yearWithinCentury.
| bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::isSelfConsistent | ( | const PartialParse & | parsed, |
| TemporalFieldCategory | category ) const |
| bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::resolve | ( | PartialParse & | parsed | ) | const |
Definition at line 378 of file qtparsetemporal.cpp.
References QT_BEGIN_NAMESPACE::PartialParse::hourMod12, QT_BEGIN_NAMESPACE::PartialParse::Irreconcilable, QT_BEGIN_NAMESPACE::PartialParse::LegacyResolves, QT_BEGIN_NAMESPACE::PartialParse::periodInDay, QT_BEGIN_NAMESPACE::PartialParse::ResolutionChanges, QT_BEGIN_NAMESPACE::PartialParse::SelfResolved, QT_BEGIN_NAMESPACE::PartialParse::UnknownAmHour, QT_BEGIN_NAMESPACE::PartialParse::UnknownPmHour, and QT_BEGIN_NAMESPACE::PartialParse::yearWithinCentury.
| bool QT_BEGIN_NAMESPACE::TemporalFieldMatcher::resolve | ( | PartialParse & | parsed | ) | const |