File indexing completed on 2026-05-03 08:13:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef _LIBCPP___CXX03___CHRONO_TZDB_LIST_H
0013 #define _LIBCPP___CXX03___CHRONO_TZDB_LIST_H
0014
0015 #include <__cxx03/version>
0016
0017 #if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB)
0018
0019 # include <__cxx03/__chrono/time_zone.h>
0020 # include <__cxx03/__chrono/tzdb.h>
0021 # include <__cxx03/__config>
0022 # include <__cxx03/__fwd/string.h>
0023 # include <__cxx03/forward_list>
0024
0025 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0026 # pragma GCC system_header
0027 # endif
0028
0029 _LIBCPP_BEGIN_NAMESPACE_STD
0030
0031 # if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
0032 !defined(_LIBCPP_HAS_NO_LOCALIZATION)
0033
0034 namespace chrono {
0035
0036
0037
0038
0039
0040
0041
0042 class _LIBCPP_AVAILABILITY_TZDB tzdb_list {
0043 public:
0044 class __impl;
0045 _LIBCPP_HIDE_FROM_ABI explicit tzdb_list(__impl* __p) : __impl_(__p) {
0046 _LIBCPP_ASSERT_NON_NULL(__impl_ != nullptr, "initialized time_zone without a valid pimpl object");
0047 }
0048 _LIBCPP_EXPORTED_FROM_ABI ~tzdb_list();
0049
0050 tzdb_list(const tzdb_list&) = delete;
0051 tzdb_list& operator=(const tzdb_list&) = delete;
0052
0053 using const_iterator = forward_list<tzdb>::const_iterator;
0054
0055 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const tzdb& front() const noexcept { return __front(); }
0056
0057 _LIBCPP_HIDE_FROM_ABI const_iterator erase_after(const_iterator __p) { return __erase_after(__p); }
0058
0059 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept { return __begin(); }
0060 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept { return __end(); }
0061
0062 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return __cbegin(); }
0063 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return __cend(); }
0064
0065 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI __impl& __implementation() { return *__impl_; }
0066
0067 private:
0068 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI const tzdb& __front() const noexcept;
0069
0070 _LIBCPP_EXPORTED_FROM_ABI const_iterator __erase_after(const_iterator __p);
0071
0072 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI const_iterator __begin() const noexcept;
0073 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI const_iterator __end() const noexcept;
0074
0075 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI const_iterator __cbegin() const noexcept;
0076 [[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI const_iterator __cend() const noexcept;
0077
0078 __impl* __impl_;
0079 };
0080
0081 [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI tzdb_list& get_tzdb_list();
0082
0083 [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const tzdb& get_tzdb() {
0084 return get_tzdb_list().front();
0085 }
0086
0087 [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const time_zone* locate_zone(string_view __name) {
0088 return get_tzdb().locate_zone(__name);
0089 }
0090
0091 [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const time_zone* current_zone() {
0092 return get_tzdb().current_zone();
0093 }
0094
0095 _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb();
0096
0097 [[nodiscard]] _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version();
0098
0099 }
0100
0101 # endif
0102
0103
0104 _LIBCPP_END_NAMESPACE_STD
0105
0106 #endif
0107
0108 #endif