1/*
2 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "timezonedata_p.h"
8
9#include "data/country_timezone_map.cpp"
10#include "data/subdivision_timezone_map.cpp"
11#include "data/timezone_name_table.cpp"
12
13#include <cassert>
14
15static_assert(isSortedLookupTable(map: country_timezone_map));
16static_assert(isSortedLookupTable(map: subdivision_timezone_map));
17
18const char *TimezoneData::ianaIdLookup(uint16_t offset)
19{
20 assert(offset < sizeof(timezone_name_table));
21 return timezone_name_table + offset;
22}
23
24const MapEntry<uint16_t> *TimezoneData::countryTimezoneMapBegin()
25{
26 return std::begin(arr: country_timezone_map);
27}
28
29const MapEntry<uint16_t> *TimezoneData::countryTimezoneMapEnd()
30{
31 return std::end(arr: country_timezone_map);
32}
33
34const MapEntry<uint32_t> *TimezoneData::subdivisionTimezoneMapBegin()
35{
36 return std::begin(arr: subdivision_timezone_map);
37}
38
39const MapEntry<uint32_t> *TimezoneData::subdivisionTimezoneMapEnd()
40{
41 return std::end(arr: subdivision_timezone_map);
42}
43

source code of ki18n/src/localedata/timezonedata.cpp