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
26
27QT_BEGIN_NAMESPACE
28
29namespace QtParseTimeZone {
30
32{
35
36 constexpr QDateTime::TransitionResolution resolveType() const noexcept
37 {
38 // How to resolve QDateTime construction to favour the timeType parsed:
39 using Res = QDateTime::TransitionResolution;
40 switch (timeType) {
41 case QDateTimePrivate::StandardTime: return Res::PreferStandard;
42 case QDateTimePrivate::DaylightTime: return Res::PreferDaylightSaving;
43 case QDateTimePrivate::UnknownDaylightTime: return Res::LegacyBehavior;
44 }
45 Q_UNREACHABLE_RETURN(Res::LegacyBehavior);
46 }
47};
48
54
55// Corresponding to QDTP::findTimeZone's modes (count('t') in Qt format field):
62 // TODO: distinguish modes 2 and 3
75
76// Parsing functions return lists, sorted with "better" matches earlier; for
77// now, longer is better.
78
79Q_AUTOTEST_EXPORT // so that we can test it
82// QList<ParsedZone> find(QStringView text, const QLocale &locale, qsizetype from = 0,
83// QtTemporalPattern::TemporalFieldFlags flags = AnyZoneForm);
84} // QtParseTimeZone
85
86QT_END_NAMESPACE
87
88#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