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
qtparsetemporal_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QTPARSE_TEMPORAL_P_H
4#define QTPARSE_TEMPORAL_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtCore/qcalendar.h>
18#include <QtCore/qdatetime.h>
19#include <QtCore/qflags.h>
20#include <QtCore/qlocale.h>
21#include <QtCore/qstringview.h>
22#include <QtCore/qtimezone.h>
23
24#include <QtCore/private/qtparsetimezone_p.h>
25#include <QtCore/private/qttemporalpattern_p.h>
26
27#include <optional>
28
30
31QT_BEGIN_NAMESPACE
32
33namespace QtParseTemporal {
35 // Time fields:
36 int millis = -1;
37 int second = -1;
38 int minute = -1;
39 int hour = -1; // Before parsing last field, -1 just means unknown hour.
40 // After: -1: fully unknown, < -1: unknown am, > 24 unknown pm, otherwise known,
41 // Date fields:
42 int dayOfWeek = 0;
43 int dayOfMonth = 0;
44 int month = 0;
45 // Some calendars do allow any integer as year, for all that we implement
46 // most without a year zero. So use an optional for the year.
47 std::optional<int> year;
48 // Indexing (of boundaries between fields):
50 // (See ParsedText base for start and end; and ParsedZone for zone.)
51
52 // Convenience accessors for the data fields:
53 QDate date(QCalendar cal, QDate defaults = {}) const;
54 QTime time(QTime defaults = {}) const;
55 // The latter uses hour's quirky am/pm hints to adapt defaults.hour().
56};
57
58Q_AUTOTEST_EXPORT
62 qsizetype from = 0);
63} // QtParseTemporal
64
65QT_END_NAMESPACE
66
67#endif // QTPARSE_TEMPORAL_P_H
QT_REQUIRE_CONFIG(datetimeparser)
std::vector< qsizetype > bounds
QTime time(QTime defaults={}) const
QDate date(QCalendar cal, QDate defaults={}) const