[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libcxx / include / __chrono / tzdb_list.h
blob0494826c01a339ad7dd079a27a33f50ecbc52c4b
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 // For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html
12 #ifndef _LIBCPP___CHRONO_TZDB_LIST_H
13 #define _LIBCPP___CHRONO_TZDB_LIST_H
15 #include <version>
16 // Enable the contents of the header only when libc++ was built with experimental features enabled.
17 #if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
19 # include <__availability>
20 # include <__chrono/tzdb.h>
21 # include <forward_list>
22 # include <string_view>
24 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
25 # pragma GCC system_header
26 # endif
28 _LIBCPP_BEGIN_NAMESPACE_STD
30 # if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
31 !defined(_LIBCPP_HAS_NO_LOCALIZATION)
33 namespace chrono {
35 class _LIBCPP_AVAILABILITY_TZDB tzdb_list {
36 public:
37 _LIBCPP_EXPORTED_FROM_ABI explicit tzdb_list(tzdb&& __tzdb);
38 _LIBCPP_EXPORTED_FROM_ABI ~tzdb_list();
40 tzdb_list(const tzdb_list&) = delete;
41 tzdb_list& operator=(const tzdb_list&) = delete;
43 using const_iterator = forward_list<tzdb>::const_iterator;
45 _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI const tzdb& front() const noexcept;
47 _LIBCPP_EXPORTED_FROM_ABI const_iterator erase_after(const_iterator __p);
49 _LIBCPP_EXPORTED_FROM_ABI tzdb& __emplace_front(tzdb&& __tzdb);
51 _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI const_iterator begin() const noexcept;
52 _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI const_iterator end() const noexcept;
54 _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI const_iterator cbegin() const noexcept;
55 _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI const_iterator cend() const noexcept;
57 private:
58 class __impl;
59 __impl* __impl_;
62 _LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI tzdb_list& get_tzdb_list();
64 _LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline const tzdb& get_tzdb() {
65 return get_tzdb_list().front();
68 _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb();
70 _LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI string remote_version();
72 } // namespace chrono
74 # endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
75 // && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
77 _LIBCPP_END_NAMESPACE_STD
79 #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
81 #endif // _LIBCPP___CHRONO_TZDB_LIST_H