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
QtTemporalPattern::TemporalField Class Reference

Describes one field in a temporal pattern. More...

#include <qttemporalpattern_p.h>

Collaboration diagram for QtTemporalPattern::TemporalField:

Public Member Functions

DateTimePart part () const noexcept

Public Attributes

QString literal
qsizetype width
TemporalFieldFlags options
TemporalFieldCategory category

Friends

bool comparesEqual (const TemporalField &lhs, const TemporalField &rhs) noexcept

Detailed Description

Describes one field in a temporal pattern.

A single field is characterized by its \l {QtTemporalPattern::TemporalFieldCategory}{category}, some \l {QtTemporalPattern::TemporalFieldFlags}{options} identifying how the field is to be expressed and, where relevant, a datum. For a Literal field, the datum is the string to be matched.

For numeric fields, a width may optionally be specified, indicating the expected number of digits in the field. If options specifies zero-padding, this is a minimum number of digits; otherwise, shorter fields are accepted. In any case, longer values are accepted, where the resulting numeric value is valid for the field. A zero width does not mean an empty field will be accepted: it is effectively equivalent to a width of 1.

Note
in some locales, the digits may require surrogate pairs to encode, so the UTF-16 length of the field may exceed the number of digits. In a year field with a sign, the sign does not count towards the width of the field. The width only counts digits. The width is, in any case, a lower bound: more digits may be read, if present and not consumed by some later field. The endIndex of any parse result is the only reliable source of truth on the UTF-16 end of the text parsed.

Definition at line 141 of file qttemporalpattern_p.h.

Member Function Documentation

◆ part()

DateTimePart QtTemporalPattern::TemporalField::part ( ) const
inlinenoexcept

Definition at line 146 of file qttemporalpattern_p.h.

◆ comparesEqual

bool comparesEqual ( const TemporalField & lhs,
const TemporalField & rhs )
friend

Definition at line 147 of file qttemporalpattern_p.h.

Member Data Documentation

◆ category

TemporalFieldCategory QtTemporalPattern::TemporalField::category

Definition at line 145 of file qttemporalpattern_p.h.

◆ literal

QString QtTemporalPattern::TemporalField::literal

Definition at line 142 of file qttemporalpattern_p.h.

◆ options

◆ width

qsizetype QtTemporalPattern::TemporalField::width

Definition at line 143 of file qttemporalpattern_p.h.


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