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#ifndef QPARSE_TIMEZONE_P_H
4#define QPARSE_TIMEZONE_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/private/qtparsecommon_p.h>
18#include <QtCore/private/qdatetime_p.h>
19#include <QtCore/qflags.h>
20#include <QtCore/qlocale.h>
21#include <QtCore/qtimezone.h>
22#include <QtCore/private/qttemporalpattern_p.h>
23
25
26QT_BEGIN_NAMESPACE
27
28namespace QtParseTimeZone {
29
31{
34
35 constexpr QDateTime::TransitionResolution resolveType() const noexcept
36 {
37 // How to resolve QDateTime construction to favour the timeType parsed:
38 using Res = QDateTime::TransitionResolution;
39 switch (timeType) {
40 case QDateTimePrivate::StandardTime: return Res::PreferStandard;
41 case QDateTimePrivate::DaylightTime: return Res::PreferDaylightSaving;
42 case QDateTimePrivate::UnknownDaylightTime: return Res::LegacyBehavior;
43 }
44 Q_UNREACHABLE_RETURN(Res::LegacyBehavior);
45 }
46};
47
53
54// Corresponding to QDTP::findTimeZone's modes (count('t') in Qt format field):
61 // TODO: distinguish modes 2 and 3
74
75// Parsing functions return lists, sorted with "better" matches earlier; for
76// now, longer is better.
77
78Q_AUTOTEST_EXPORT // so that we can test it
81// QList<ParsedZone> find(QStringView text, const QLocale &locale, qsizetype from = 0,
82// QtTemporalPattern::TemporalFieldFlags flags = AnyZoneForm);
83} // QtParseTimeZone
84
85QT_END_NAMESPACE
86
87#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