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