File indexing completed on 2024-11-24 04:45:05
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "knowledgedb.h" 0010 0011 #include <QByteArray> 0012 #include <QString> 0013 0014 #include <map> 0015 #include <vector> 0016 0017 namespace KItinerary { 0018 namespace Generator { 0019 0020 class Timezones 0021 { 0022 public: 0023 Timezones(); 0024 ~Timezones(); 0025 0026 // the offset into the timezone string table 0027 uint16_t offset(const QByteArray &tz) const; 0028 0029 private: 0030 friend class TimezoneDbGenerator; 0031 0032 void setCountryForZone(const QByteArray &tz, const QString &country); 0033 void removeZone(const QByteArray &tz); 0034 0035 std::vector<QByteArray> m_zones; 0036 std::vector<uint16_t> m_zoneOffsets; 0037 0038 std::map<QString, std::vector<QByteArray>> m_countryZones; 0039 std::map<QByteArray, QString> m_countryForZone; 0040 }; 0041 0042 } 0043 } 0044