Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | 9bd9388 | 2021-11-17 16:25:01 -0500 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 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 |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | #ifndef _LIBCPP_FILESYSTEM |
| 10 | #define _LIBCPP_FILESYSTEM |
Louis Dionne | b4fce35 | 2022-03-25 12:55:36 -0400 | [diff] [blame] | 11 | |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 12 | /* |
| 13 | filesystem synopsis |
| 14 | |
Joe Loser | 9d1c0d4 | 2021-10-14 11:53:43 -0400 | [diff] [blame] | 15 | namespace std::filesystem { |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 16 | |
Adrian Vogelsgesang | 25763c0 | 2022-07-31 15:21:01 -0700 | [diff] [blame] | 17 | // `class path` from http://eel.is/c++draft/fs.class.path.general#6 |
| 18 | class path { |
| 19 | public: |
| 20 | using value_type = see below; |
| 21 | using string_type = basic_string<value_type>; |
| 22 | static constexpr value_type preferred_separator = see below; |
| 23 | |
| 24 | enum format; |
| 25 | |
| 26 | path() noexcept; |
| 27 | path(const path& p); |
| 28 | path(path&& p) noexcept; |
| 29 | path(string_type&& source, format fmt = auto_format); |
| 30 | template<class Source> |
| 31 | path(const Source& source, format fmt = auto_format); |
| 32 | template<class InputIterator> |
| 33 | path(InputIterator first, InputIterator last, format fmt = auto_format); |
| 34 | template<class Source> |
| 35 | path(const Source& source, const locale& loc, format fmt = auto_format); |
| 36 | template<class InputIterator> |
| 37 | path(InputIterator first, InputIterator last, const locale& loc, format fmt = auto_format); |
| 38 | ~path(); |
| 39 | |
| 40 | path& operator=(const path& p); |
| 41 | path& operator=(path&& p) noexcept; |
| 42 | path& operator=(string_type&& source); |
| 43 | path& assign(string_type&& source); |
| 44 | template<class Source> |
| 45 | path& operator=(const Source& source); |
| 46 | template<class Source> |
| 47 | path& assign(const Source& source); |
| 48 | template<class InputIterator> |
| 49 | path& assign(InputIterator first, InputIterator last); |
| 50 | |
| 51 | path& operator/=(const path& p); |
| 52 | template<class Source> |
| 53 | path& operator/=(const Source& source); |
| 54 | template<class Source> |
| 55 | path& append(const Source& source); |
| 56 | template<class InputIterator> |
| 57 | path& append(InputIterator first, InputIterator last); |
| 58 | |
| 59 | path& operator+=(const path& x); |
| 60 | path& operator+=(const string_type& x); |
| 61 | path& operator+=(basic_string_view<value_type> x); |
| 62 | path& operator+=(const value_type* x); |
| 63 | path& operator+=(value_type x); |
| 64 | template<class Source> |
| 65 | path& operator+=(const Source& x); |
| 66 | template<class EcharT> |
| 67 | path& operator+=(EcharT x); |
| 68 | template<class Source> |
| 69 | path& concat(const Source& x); |
| 70 | template<class InputIterator> |
| 71 | path& concat(InputIterator first, InputIterator last); |
| 72 | |
| 73 | void clear() noexcept; |
| 74 | path& make_preferred(); |
| 75 | path& remove_filename(); |
| 76 | path& replace_filename(const path& replacement); |
| 77 | path& replace_extension(const path& replacement = path()); |
| 78 | void swap(path& rhs) noexcept; |
| 79 | |
| 80 | friend bool operator==(const path& lhs, const path& rhs) noexcept; |
| 81 | friend bool operator!=(const path& lhs, const path& rhs) noexcept; // removed in C++20 |
| 82 | friend bool operator< (const path& lhs, const path& rhs) noexcept; // removed in C++20 |
| 83 | friend bool operator<=(const path& lhs, const path& rhs) noexcept; // removed in C++20 |
| 84 | friend bool operator> (const path& lhs, const path& rhs) noexcept; // removed in C++20 |
| 85 | friend bool operator>=(const path& lhs, const path& rhs) noexcept; // removed in C++20 |
| 86 | friend strong_ordering operator<=>(const path& lhs, const path& rhs) noexcept; // C++20 |
| 87 | |
| 88 | friend path operator/(const path& lhs, const path& rhs); |
| 89 | |
| 90 | const string_type& native() const noexcept; |
| 91 | const value_type* c_str() const noexcept; |
| 92 | operator string_type() const; |
| 93 | |
| 94 | template<class EcharT, class traits = char_traits<EcharT>, |
| 95 | class Allocator = allocator<EcharT>> |
| 96 | basic_string<EcharT, traits, Allocator> |
| 97 | string(const Allocator& a = Allocator()) const; |
| 98 | std::string string() const; |
| 99 | std::wstring wstring() const; |
| 100 | std::u8string u8string() const; |
| 101 | std::u16string u16string() const; |
| 102 | std::u32string u32string() const; |
| 103 | |
| 104 | template<class EcharT, class traits = char_traits<EcharT>, |
| 105 | class Allocator = allocator<EcharT>> |
| 106 | basic_string<EcharT, traits, Allocator> |
| 107 | generic_string(const Allocator& a = Allocator()) const; |
| 108 | std::string generic_string() const; |
| 109 | std::wstring generic_wstring() const; |
| 110 | std::u8string generic_u8string() const; |
| 111 | std::u16string generic_u16string() const; |
| 112 | std::u32string generic_u32string() const; |
| 113 | |
| 114 | int compare(const path& p) const noexcept; |
| 115 | int compare(const string_type& s) const; |
| 116 | int compare(basic_string_view<value_type> s) const; |
| 117 | int compare(const value_type* s) const; |
| 118 | |
| 119 | path root_name() const; |
| 120 | path root_directory() const; |
| 121 | path root_path() const; |
| 122 | path relative_path() const; |
| 123 | path parent_path() const; |
| 124 | path filename() const; |
| 125 | path stem() const; |
| 126 | path extension() const; |
| 127 | |
| 128 | [[nodiscard]] bool empty() const noexcept; |
| 129 | bool has_root_name() const; |
| 130 | bool has_root_directory() const; |
| 131 | bool has_root_path() const; |
| 132 | bool has_relative_path() const; |
| 133 | bool has_parent_path() const; |
| 134 | bool has_filename() const; |
| 135 | bool has_stem() const; |
| 136 | bool has_extension() const; |
| 137 | bool is_absolute() const; |
| 138 | bool is_relative() const; |
| 139 | |
| 140 | path lexically_normal() const; |
| 141 | path lexically_relative(const path& base) const; |
| 142 | path lexically_proximate(const path& base) const; |
| 143 | |
| 144 | class iterator; |
| 145 | using const_iterator = iterator; |
| 146 | |
| 147 | iterator begin() const; |
| 148 | iterator end() const; |
| 149 | |
| 150 | template<class charT, class traits> |
| 151 | friend basic_ostream<charT, traits>& |
| 152 | operator<<(basic_ostream<charT, traits>& os, const path& p); |
| 153 | template<class charT, class traits> |
| 154 | friend basic_istream<charT, traits>& |
| 155 | operator>>(basic_istream<charT, traits>& is, path& p); |
| 156 | }; |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 157 | |
| 158 | void swap(path& lhs, path& rhs) noexcept; |
| 159 | size_t hash_value(const path& p) noexcept; |
| 160 | |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 161 | template <class Source> |
| 162 | path u8path(const Source& source); |
| 163 | template <class InputIterator> |
| 164 | path u8path(InputIterator first, InputIterator last); |
| 165 | |
| 166 | class filesystem_error; |
Adrian Vogelsgesang | 91de62b | 2022-07-31 15:57:10 -0700 | [diff] [blame] | 167 | |
| 168 | class directory_entry { |
| 169 | public: |
| 170 | directory_entry() noexcept = default; |
| 171 | directory_entry(const directory_entry&) = default; |
| 172 | directory_entry(directory_entry&&) noexcept = default; |
| 173 | explicit directory_entry(const filesystem::path& p); |
| 174 | directory_entry(const filesystem::path& p, error_code& ec); |
| 175 | ~directory_entry(); |
| 176 | |
| 177 | directory_entry& operator=(const directory_entry&) = default; |
| 178 | directory_entry& operator=(directory_entry&&) noexcept = default; |
| 179 | |
| 180 | void assign(const filesystem::path& p); |
| 181 | void assign(const filesystem::path& p, error_code& ec); |
| 182 | void replace_filename(const filesystem::path& p); |
| 183 | void replace_filename(const filesystem::path& p, error_code& ec); |
| 184 | void refresh(); |
| 185 | void refresh(error_code& ec) noexcept; |
| 186 | |
| 187 | const filesystem::path& path() const noexcept; |
| 188 | operator const filesystem::path&() const noexcept; |
| 189 | bool exists() const; |
| 190 | bool exists(error_code& ec) const noexcept; |
| 191 | bool is_block_file() const; |
| 192 | bool is_block_file(error_code& ec) const noexcept; |
| 193 | bool is_character_file() const; |
| 194 | bool is_character_file(error_code& ec) const noexcept; |
| 195 | bool is_directory() const; |
| 196 | bool is_directory(error_code& ec) const noexcept; |
| 197 | bool is_fifo() const; |
| 198 | bool is_fifo(error_code& ec) const noexcept; |
| 199 | bool is_other() const; |
| 200 | bool is_other(error_code& ec) const noexcept; |
| 201 | bool is_regular_file() const; |
| 202 | bool is_regular_file(error_code& ec) const noexcept; |
| 203 | bool is_socket() const; |
| 204 | bool is_socket(error_code& ec) const noexcept; |
| 205 | bool is_symlink() const; |
| 206 | bool is_symlink(error_code& ec) const noexcept; |
| 207 | uintmax_t file_size() const; |
| 208 | uintmax_t file_size(error_code& ec) const noexcept; |
| 209 | uintmax_t hard_link_count() const; |
| 210 | uintmax_t hard_link_count(error_code& ec) const noexcept; |
| 211 | file_time_type last_write_time() const; |
| 212 | file_time_type last_write_time(error_code& ec) const noexcept; |
| 213 | file_status status() const; |
| 214 | file_status status(error_code& ec) const noexcept; |
| 215 | file_status symlink_status() const; |
| 216 | file_status symlink_status(error_code& ec) const noexcept; |
| 217 | |
| 218 | bool operator==(const directory_entry& rhs) const noexcept; |
| 219 | bool operator!=(const directory_entry& rhs) const noexcept; // removed in C++20 |
| 220 | bool operator< (const directory_entry& rhs) const noexcept; // removed in C++20 |
| 221 | bool operator<=(const directory_entry& rhs) const noexcept; // removed in C++20 |
| 222 | bool operator> (const directory_entry& rhs) const noexcept; // removed in C++20 |
| 223 | bool operator>=(const directory_entry& rhs) const noexcept; // removed in C++20 |
| 224 | strong_ordering operator<=>(const directory_entry& rhs) const noexcept; // since C++20 |
| 225 | |
| 226 | template<class charT, class traits> |
| 227 | friend basic_ostream<charT, traits>& |
| 228 | operator<<(basic_ostream<charT, traits>& os, const directory_entry& d); |
| 229 | |
| 230 | private: |
| 231 | filesystem::path pathobject; // exposition only |
| 232 | friend class directory_iterator; // exposition only |
| 233 | }; |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 234 | |
| 235 | class directory_iterator; |
| 236 | |
| 237 | // enable directory_iterator range-based for statements |
| 238 | directory_iterator begin(directory_iterator iter) noexcept; |
Joe Loser | 9d1c0d4 | 2021-10-14 11:53:43 -0400 | [diff] [blame] | 239 | directory_iterator end(directory_iterator) noexcept; |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 240 | |
| 241 | class recursive_directory_iterator; |
| 242 | |
| 243 | // enable recursive_directory_iterator range-based for statements |
| 244 | recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept; |
Joe Loser | 9d1c0d4 | 2021-10-14 11:53:43 -0400 | [diff] [blame] | 245 | recursive_directory_iterator end(recursive_directory_iterator) noexcept; |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 246 | |
| 247 | class file_status; |
| 248 | |
| 249 | struct space_info |
| 250 | { |
| 251 | uintmax_t capacity; |
| 252 | uintmax_t free; |
| 253 | uintmax_t available; |
Adrian Vogelsgesang | fe1bc75 | 2022-07-31 16:12:42 -0700 | [diff] [blame] | 254 | |
| 255 | friend bool operator==(const space_info&, const space_info&) = default; // C++20 |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 256 | }; |
| 257 | |
| 258 | enum class file_type; |
| 259 | enum class perms; |
| 260 | enum class perm_options; |
| 261 | enum class copy_options; |
| 262 | enum class directory_options; |
| 263 | |
| 264 | typedef chrono::time_point<trivial-clock> file_time_type; |
| 265 | |
| 266 | // operational functions |
| 267 | |
| 268 | path absolute(const path& p); |
| 269 | path absolute(const path& p, error_code &ec); |
| 270 | |
| 271 | path canonical(const path& p); |
| 272 | path canonical(const path& p, error_code& ec); |
| 273 | |
| 274 | void copy(const path& from, const path& to); |
| 275 | void copy(const path& from, const path& to, error_code& ec); |
| 276 | void copy(const path& from, const path& to, copy_options options); |
| 277 | void copy(const path& from, const path& to, copy_options options, |
| 278 | error_code& ec); |
| 279 | |
| 280 | bool copy_file(const path& from, const path& to); |
| 281 | bool copy_file(const path& from, const path& to, error_code& ec); |
| 282 | bool copy_file(const path& from, const path& to, copy_options option); |
| 283 | bool copy_file(const path& from, const path& to, copy_options option, |
| 284 | error_code& ec); |
| 285 | |
| 286 | void copy_symlink(const path& existing_symlink, const path& new_symlink); |
| 287 | void copy_symlink(const path& existing_symlink, const path& new_symlink, |
| 288 | error_code& ec) noexcept; |
| 289 | |
| 290 | bool create_directories(const path& p); |
| 291 | bool create_directories(const path& p, error_code& ec); |
| 292 | |
| 293 | bool create_directory(const path& p); |
| 294 | bool create_directory(const path& p, error_code& ec) noexcept; |
| 295 | |
| 296 | bool create_directory(const path& p, const path& attributes); |
| 297 | bool create_directory(const path& p, const path& attributes, |
| 298 | error_code& ec) noexcept; |
| 299 | |
| 300 | void create_directory_symlink(const path& to, const path& new_symlink); |
| 301 | void create_directory_symlink(const path& to, const path& new_symlink, |
| 302 | error_code& ec) noexcept; |
| 303 | |
| 304 | void create_hard_link(const path& to, const path& new_hard_link); |
| 305 | void create_hard_link(const path& to, const path& new_hard_link, |
| 306 | error_code& ec) noexcept; |
| 307 | |
| 308 | void create_symlink(const path& to, const path& new_symlink); |
| 309 | void create_symlink(const path& to, const path& new_symlink, |
| 310 | error_code& ec) noexcept; |
| 311 | |
| 312 | path current_path(); |
| 313 | path current_path(error_code& ec); |
| 314 | void current_path(const path& p); |
| 315 | void current_path(const path& p, error_code& ec) noexcept; |
| 316 | |
| 317 | bool exists(file_status s) noexcept; |
| 318 | bool exists(const path& p); |
| 319 | bool exists(const path& p, error_code& ec) noexcept; |
| 320 | |
| 321 | bool equivalent(const path& p1, const path& p2); |
| 322 | bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept; |
| 323 | |
| 324 | uintmax_t file_size(const path& p); |
| 325 | uintmax_t file_size(const path& p, error_code& ec) noexcept; |
| 326 | |
| 327 | uintmax_t hard_link_count(const path& p); |
| 328 | uintmax_t hard_link_count(const path& p, error_code& ec) noexcept; |
| 329 | |
| 330 | bool is_block_file(file_status s) noexcept; |
| 331 | bool is_block_file(const path& p); |
| 332 | bool is_block_file(const path& p, error_code& ec) noexcept; |
| 333 | |
| 334 | bool is_character_file(file_status s) noexcept; |
| 335 | bool is_character_file(const path& p); |
| 336 | bool is_character_file(const path& p, error_code& ec) noexcept; |
| 337 | |
| 338 | bool is_directory(file_status s) noexcept; |
| 339 | bool is_directory(const path& p); |
| 340 | bool is_directory(const path& p, error_code& ec) noexcept; |
| 341 | |
| 342 | bool is_empty(const path& p); |
| 343 | bool is_empty(const path& p, error_code& ec) noexcept; |
| 344 | |
| 345 | bool is_fifo(file_status s) noexcept; |
| 346 | bool is_fifo(const path& p); |
| 347 | bool is_fifo(const path& p, error_code& ec) noexcept; |
| 348 | |
| 349 | bool is_other(file_status s) noexcept; |
| 350 | bool is_other(const path& p); |
| 351 | bool is_other(const path& p, error_code& ec) noexcept; |
| 352 | |
| 353 | bool is_regular_file(file_status s) noexcept; |
| 354 | bool is_regular_file(const path& p); |
| 355 | bool is_regular_file(const path& p, error_code& ec) noexcept; |
| 356 | |
| 357 | bool is_socket(file_status s) noexcept; |
| 358 | bool is_socket(const path& p); |
| 359 | bool is_socket(const path& p, error_code& ec) noexcept; |
| 360 | |
| 361 | bool is_symlink(file_status s) noexcept; |
| 362 | bool is_symlink(const path& p); |
| 363 | bool is_symlink(const path& p, error_code& ec) noexcept; |
| 364 | |
| 365 | file_time_type last_write_time(const path& p); |
| 366 | file_time_type last_write_time(const path& p, error_code& ec) noexcept; |
| 367 | void last_write_time(const path& p, file_time_type new_time); |
| 368 | void last_write_time(const path& p, file_time_type new_time, |
| 369 | error_code& ec) noexcept; |
| 370 | |
| 371 | void permissions(const path& p, perms prms, |
| 372 | perm_options opts=perm_options::replace); |
| 373 | void permissions(const path& p, perms prms, error_code& ec) noexcept; |
| 374 | void permissions(const path& p, perms prms, perm_options opts, |
| 375 | error_code& ec); |
| 376 | |
| 377 | path proximate(const path& p, error_code& ec); |
| 378 | path proximate(const path& p, const path& base = current_path()); |
| 379 | path proximate(const path& p, const path& base, error_code &ec); |
| 380 | |
| 381 | path read_symlink(const path& p); |
| 382 | path read_symlink(const path& p, error_code& ec); |
| 383 | |
| 384 | path relative(const path& p, error_code& ec); |
| 385 | path relative(const path& p, const path& base=current_path()); |
| 386 | path relative(const path& p, const path& base, error_code& ec); |
| 387 | |
| 388 | bool remove(const path& p); |
| 389 | bool remove(const path& p, error_code& ec) noexcept; |
| 390 | |
| 391 | uintmax_t remove_all(const path& p); |
| 392 | uintmax_t remove_all(const path& p, error_code& ec); |
| 393 | |
| 394 | void rename(const path& from, const path& to); |
| 395 | void rename(const path& from, const path& to, error_code& ec) noexcept; |
| 396 | |
| 397 | void resize_file(const path& p, uintmax_t size); |
| 398 | void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept; |
| 399 | |
| 400 | space_info space(const path& p); |
| 401 | space_info space(const path& p, error_code& ec) noexcept; |
| 402 | |
| 403 | file_status status(const path& p); |
| 404 | file_status status(const path& p, error_code& ec) noexcept; |
| 405 | |
| 406 | bool status_known(file_status s) noexcept; |
| 407 | |
| 408 | file_status symlink_status(const path& p); |
| 409 | file_status symlink_status(const path& p, error_code& ec) noexcept; |
| 410 | |
| 411 | path temp_directory_path(); |
| 412 | path temp_directory_path(error_code& ec); |
| 413 | |
| 414 | path weakly_canonical(path const& p); |
| 415 | path weakly_canonical(path const& p, error_code& ec); |
| 416 | |
Joe Loser | 9d1c0d4 | 2021-10-14 11:53:43 -0400 | [diff] [blame] | 417 | } // namespace std::filesystem |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 418 | |
Joe Loser | 9d1c0d4 | 2021-10-14 11:53:43 -0400 | [diff] [blame] | 419 | template <> |
| 420 | inline constexpr bool std::ranges::enable_borrowed_range<std::filesystem::directory_iterator> = true; |
| 421 | template <> |
| 422 | inline constexpr bool std::ranges::enable_borrowed_range<std::filesystem::recursive_directory_iterator> = true; |
| 423 | |
| 424 | template <> |
| 425 | inline constexpr bool std::ranges::enable_view<std::filesystem::directory_iterator> = true; |
| 426 | template <> |
| 427 | inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_directory_iterator> = true; |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 428 | |
| 429 | */ |
| 430 | |
Louis Dionne | b4fce35 | 2022-03-25 12:55:36 -0400 | [diff] [blame] | 431 | #include <__assert> // all public C++ headers provide the assertion handler |
Nikolas Klauser | 0d7bb8b | 2021-12-23 11:55:38 +0100 | [diff] [blame] | 432 | #include <__config> |
Nikolas Klauser | d2ef106 | 2021-12-23 12:21:00 +0100 | [diff] [blame] | 433 | #include <__filesystem/copy_options.h> |
| 434 | #include <__filesystem/directory_entry.h> |
| 435 | #include <__filesystem/directory_iterator.h> |
| 436 | #include <__filesystem/directory_options.h> |
| 437 | #include <__filesystem/file_status.h> |
| 438 | #include <__filesystem/file_time_type.h> |
| 439 | #include <__filesystem/file_type.h> |
| 440 | #include <__filesystem/filesystem_error.h> |
| 441 | #include <__filesystem/operations.h> |
Nikolas Klauser | d2ef106 | 2021-12-23 12:21:00 +0100 | [diff] [blame] | 442 | #include <__filesystem/path.h> |
Arthur O'Dwyer | 65077c0 | 2022-01-07 09:45:05 -0500 | [diff] [blame] | 443 | #include <__filesystem/path_iterator.h> |
Nikolas Klauser | d2ef106 | 2021-12-23 12:21:00 +0100 | [diff] [blame] | 444 | #include <__filesystem/perm_options.h> |
| 445 | #include <__filesystem/perms.h> |
| 446 | #include <__filesystem/recursive_directory_iterator.h> |
| 447 | #include <__filesystem/space_info.h> |
| 448 | #include <__filesystem/u8path.h> |
Marshall Clow | 0a1e750 | 2018-09-12 19:41:40 +0000 | [diff] [blame] | 449 | #include <version> |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 450 | |
Nikolas Klauser | a0e0edb | 2022-06-16 22:43:46 +0200 | [diff] [blame] | 451 | // standard-mandated includes |
Nikolas Klauser | 71619e7 | 2022-09-22 18:05:08 +0200 | [diff] [blame] | 452 | |
| 453 | // [fs.filesystem.syn] |
Nikolas Klauser | a0e0edb | 2022-06-16 22:43:46 +0200 | [diff] [blame] | 454 | #include <compare> |
| 455 | |
Louis Dionne | db84e12 | 2021-01-18 12:18:18 -0500 | [diff] [blame] | 456 | #if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) |
Louis Dionne | 685c470 | 2022-05-18 13:17:14 -0400 | [diff] [blame] | 457 | # error "The <filesystem> library is not supported since libc++ has been configured without support for a filesystem." |
Louis Dionne | db84e12 | 2021-01-18 12:18:18 -0500 | [diff] [blame] | 458 | #endif |
| 459 | |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 460 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | 6eeaa00 | 2022-02-01 20:16:40 -0500 | [diff] [blame] | 461 | # pragma GCC system_header |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 462 | #endif |
| 463 | |
Eric Fiselier | 02cea5e | 2018-07-27 03:07:09 +0000 | [diff] [blame] | 464 | #endif // _LIBCPP_FILESYSTEM |