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
qtparsetimezone_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 QPARSE_TIMEZONE_P_H
5#define QPARSE_TIMEZONE_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/private/qtparsecommon_p.h>
19#include <QtCore/private/qdatetime_p.h>
20#include <QtCore/qflags.h>
21#include <QtCore/qlocale.h>
22#include <QtCore/qtimezone.h>
23#include <QtCore/private/qttemporalpattern_p.h>
24
25#include <optional>
26
28
29QT_BEGIN_NAMESPACE
30
31namespace QtParseTimeZone {
32
34{
37
38 constexpr QDateTime::TransitionResolution resolveType() const noexcept
39 {
40 // How to resolve QDateTime construction to favour the timeType parsed:
41 using Res = QDateTime::TransitionResolution;
42 switch (timeType) {
43 case QDateTimePrivate::StandardTime: return Res::PreferStandard;
44 case QDateTimePrivate::DaylightTime: return Res::PreferDaylightSaving;
45 case QDateTimePrivate::UnknownDaylightTime: return Res::LegacyBehavior;
46 }
47 Q_UNREACHABLE_RETURN(Res::LegacyBehavior);
48 }
49};
50
56
57// Corresponding to QDTP::findTimeZone's modes (count('t') in Qt format field):
64 // TODO: distinguish modes 2 and 3
77
78// Parsing functions return lists, sorted with "better" matches earlier; for
79// now, longer is better.
80
81Q_AUTOTEST_EXPORT // so that we can test it
85// QList<ParsedZone> find(QStringView text, const QLocale &locale, qsizetype from = 0,
86// QtTemporalPattern::TemporalFieldFlags flags = AnyZoneForm);
87} // QtParseTimeZone
88
89QT_END_NAMESPACE
90
91#endif // QPARSE_TIMEZONE_P_H
A toolset for parsing time zone identification strings.
constexpr QtTemporalPattern::TemporalFieldFlags AnyGlobalZoneForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyZoneName
constexpr QtTemporalPattern::TemporalFieldFlags AllLegacyForm
constexpr QtTemporalPattern::TemporalFieldFlags BasicDigitOnlyOffset
constexpr QtTemporalPattern::TemporalFieldFlags AnyZoneForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyOffsetForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyGlobalZoneName
constexpr QtTemporalPattern::TemporalFieldFlags BasicColonDigitOffset
QT_REQUIRE_CONFIG(datetimeparser)
Describes a text fragment representing a timezone.
QDateTimePrivate::DaylightStatus timeType
constexpr QDateTime::TransitionResolution resolveType() const noexcept