xref: /freebsd/contrib/llvm-project/libcxx/modules/std/filesystem.inc (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
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//===----------------------------------------------------------------------===//
9
10export namespace std::filesystem {
11  // [fs.class.path], paths
12  using std::filesystem::path;
13
14  // [fs.path.nonmember], path non-member functions
15  using std::filesystem::hash_value;
16  using std::filesystem::swap;
17
18  // [fs.class.filesystem.error], filesystem errors
19  using std::filesystem::filesystem_error;
20
21#ifndef _LIBCPP_HAS_NO_FILESYSTEM
22  // [fs.class.directory.entry], directory entries
23  using std::filesystem::directory_entry;
24
25  // [fs.class.directory.iterator], directory iterators
26  using std::filesystem::directory_iterator;
27
28  // [fs.dir.itr.nonmembers], range access for directory iterators
29  using std::filesystem::begin;
30  using std::filesystem::end;
31
32  // [fs.class.rec.dir.itr], recursive directory iterators
33  using std::filesystem::recursive_directory_iterator;
34#endif // _LIBCPP_HAS_NO_FILESYSTEM
35
36  // [fs.rec.dir.itr.nonmembers], range access for recursive directory iterators
37
38  // [fs.class.file.status], file status
39  using std::filesystem::file_status;
40  using std::filesystem::space_info;
41
42  // [fs.enum], enumerations
43  using std::filesystem::copy_options;
44  using std::filesystem::directory_options;
45  using std::filesystem::file_type;
46  using std::filesystem::perm_options;
47  using std::filesystem::perms;
48
49  using std::filesystem::file_time_type;
50
51  // several of these enums are a bitmask type.
52  // [bitmask.types] specified operators
53  using std::filesystem::operator&;
54  using std::filesystem::operator&=;
55  using std::filesystem::operator^;
56  using std::filesystem::operator^=;
57  using std::filesystem::operator|;
58  using std::filesystem::operator|=;
59  using std::filesystem::operator~;
60
61#ifndef _LIBCPP_HAS_NO_FILESYSTEM
62  // [fs.op.funcs], filesystem operations
63  using std::filesystem::absolute;
64  using std::filesystem::canonical;
65  using std::filesystem::copy;
66  using std::filesystem::copy_file;
67  using std::filesystem::copy_symlink;
68  using std::filesystem::create_directories;
69  using std::filesystem::create_directory;
70  using std::filesystem::create_directory_symlink;
71  using std::filesystem::create_hard_link;
72  using std::filesystem::create_symlink;
73  using std::filesystem::current_path;
74  using std::filesystem::equivalent;
75  using std::filesystem::exists;
76  using std::filesystem::file_size;
77  using std::filesystem::hard_link_count;
78
79  using std::filesystem::is_block_file;
80  using std::filesystem::is_character_file;
81  using std::filesystem::is_directory;
82  using std::filesystem::is_empty;
83  using std::filesystem::is_fifo;
84  using std::filesystem::is_other;
85  using std::filesystem::is_regular_file;
86  using std::filesystem::is_socket;
87  using std::filesystem::is_symlink;
88
89  using std::filesystem::last_write_time;
90  using std::filesystem::permissions;
91  using std::filesystem::proximate;
92  using std::filesystem::read_symlink;
93  using std::filesystem::relative;
94  using std::filesystem::remove;
95
96  using std::filesystem::remove_all;
97  using std::filesystem::rename;
98  using std::filesystem::resize_file;
99  using std::filesystem::space;
100  using std::filesystem::status;
101  using std::filesystem::status_known;
102  using std::filesystem::symlink_status;
103  using std::filesystem::temp_directory_path;
104  using std::filesystem::weakly_canonical;
105#endif // _LIBCPP_HAS_NO_FILESYSTEM
106
107  // [depr.fs.path.factory]
108  using std::filesystem::u8path;
109} // namespace std::filesystem
110
111// [fs.path.hash], hash support
112export namespace std {
113  using std::hash;
114}
115
116export namespace std::ranges {
117#ifndef _LIBCPP_HAS_NO_FILESYSTEM
118  using std::ranges::enable_borrowed_range;
119  using std::ranges::enable_view;
120#endif // _LIBCPP_HAS_NO_FILESYSTEM
121} // namespace std::ranges
122