aboutsummaryrefslogtreecommitdiff
path: root/libcxx/modules/std/filesystem.inc
blob: 0437a3280250162ee1c7d393619e5c8e28af0007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

export namespace std::filesystem {
  // [fs.class.path], paths
  using std::filesystem::path;

  // [fs.path.nonmember], path non-member functions
  using std::filesystem::hash_value;
  using std::filesystem::swap;

  // [fs.class.filesystem.error], filesystem errors
  using std::filesystem::filesystem_error;

#if _LIBCPP_HAS_FILESYSTEM
  // [fs.class.directory.entry], directory entries
  using std::filesystem::directory_entry;

  // [fs.class.directory.iterator], directory iterators
  using std::filesystem::directory_iterator;

  // [fs.dir.itr.nonmembers], range access for directory iterators
  using std::filesystem::begin;
  using std::filesystem::end;

  // [fs.class.rec.dir.itr], recursive directory iterators
  using std::filesystem::recursive_directory_iterator;
#endif // _LIBCPP_HAS_FILESYSTEM

  // [fs.rec.dir.itr.nonmembers], range access for recursive directory iterators

  // [fs.class.file.status], file status
  using std::filesystem::file_status;
  using std::filesystem::space_info;

  // [fs.enum], enumerations
  using std::filesystem::copy_options;
  using std::filesystem::directory_options;
  using std::filesystem::file_type;
  using std::filesystem::perm_options;
  using std::filesystem::perms;

  using std::filesystem::file_time_type;

  // several of these enums are a bitmask type.
  // [bitmask.types] specified operators
  using std::filesystem::operator&;
  using std::filesystem::operator&=;
  using std::filesystem::operator^;
  using std::filesystem::operator^=;
  using std::filesystem::operator|;
  using std::filesystem::operator|=;
  using std::filesystem::operator~;

#if _LIBCPP_HAS_FILESYSTEM
  // [fs.op.funcs], filesystem operations
  using std::filesystem::absolute;
  using std::filesystem::canonical;
  using std::filesystem::copy;
  using std::filesystem::copy_file;
  using std::filesystem::copy_symlink;
  using std::filesystem::create_directories;
  using std::filesystem::create_directory;
  using std::filesystem::create_directory_symlink;
  using std::filesystem::create_hard_link;
  using std::filesystem::create_symlink;
  using std::filesystem::current_path;
  using std::filesystem::equivalent;
  using std::filesystem::exists;
  using std::filesystem::file_size;
  using std::filesystem::hard_link_count;

  using std::filesystem::is_block_file;
  using std::filesystem::is_character_file;
  using std::filesystem::is_directory;
  using std::filesystem::is_empty;
  using std::filesystem::is_fifo;
  using std::filesystem::is_other;
  using std::filesystem::is_regular_file;
  using std::filesystem::is_socket;
  using std::filesystem::is_symlink;

  using std::filesystem::last_write_time;
  using std::filesystem::permissions;
  using std::filesystem::proximate;
  using std::filesystem::read_symlink;
  using std::filesystem::relative;
  using std::filesystem::remove;

  using std::filesystem::remove_all;
  using std::filesystem::rename;
  using std::filesystem::resize_file;
  using std::filesystem::space;
  using std::filesystem::status;
  using std::filesystem::status_known;
  using std::filesystem::symlink_status;
  using std::filesystem::temp_directory_path;
  using std::filesystem::weakly_canonical;
#endif // _LIBCPP_HAS_FILESYSTEM

  // [depr.fs.path.factory]
  using std::filesystem::u8path;
} // namespace std::filesystem

// [fs.path.hash], hash support
export namespace std {
  using std::hash;
}

export namespace std::ranges {
#if _LIBCPP_HAS_FILESYSTEM
  using std::ranges::enable_borrowed_range;
  using std::ranges::enable_view;
#endif // _LIBCPP_HAS_FILESYSTEM
} // namespace std::ranges