From Jason Turner

[fs.filesystem.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpdxt_mjui/{from.md → to.md} +25 -46
tmp/tmpdxt_mjui/{from.md → to.md} RENAMED
@@ -1,46 +1,25 @@
1
  ### Header `<filesystem>` synopsis <a id="fs.filesystem.syn">[[fs.filesystem.syn]]</a>
2
 
3
  ``` cpp
 
 
4
  namespace std::filesystem {
5
  // [fs.class.path], paths
6
  class path;
7
 
8
  // [fs.path.nonmember], path non-member functions
9
  void swap(path& lhs, path& rhs) noexcept;
10
  size_t hash_value(const path& p) noexcept;
11
 
12
- bool operator==(const path& lhs, const path& rhs) noexcept;
13
- bool operator!=(const path& lhs, const path& rhs) noexcept;
14
- bool operator< (const path& lhs, const path& rhs) noexcept;
15
- bool operator<=(const path& lhs, const path& rhs) noexcept;
16
- bool operator> (const path& lhs, const path& rhs) noexcept;
17
- bool operator>=(const path& lhs, const path& rhs) noexcept;
18
-
19
- path operator/ (const path& lhs, const path& rhs);
20
-
21
- // [fs.path.io], path inserter and extractor
22
- template <class charT, class traits>
23
- basic_ostream<charT, traits>&
24
- operator<<(basic_ostream<charT, traits>& os, const path& p);
25
- template <class charT, class traits>
26
- basic_istream<charT, traits>&
27
- operator>>(basic_istream<charT, traits>& is, path& p);
28
-
29
- // [fs.path.factory], path factory functions
30
- template <class Source>
31
- path u8path(const Source& source);
32
- template <class InputIterator>
33
- path u8path(InputIterator first, InputIterator last);
34
-
35
- // [fs.class.filesystem_error], filesystem errors
36
  class filesystem_error;
37
 
38
- // [fs.class.directory_entry], directory entries
39
  class directory_entry;
40
 
41
- // [fs.class.directory_iterator], directory iterators
42
  class directory_iterator;
43
 
44
  // [fs.dir.itr.nonmembers], range access for directory iterators
45
  directory_iterator begin(directory_iterator iter) noexcept;
46
  directory_iterator end(const directory_iterator&) noexcept;
@@ -50,53 +29,55 @@ namespace std::filesystem {
50
 
51
  // [fs.rec.dir.itr.nonmembers], range access for recursive directory iterators
52
  recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
53
  recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
54
 
55
- // [fs.class.file_status], file status
56
  class file_status;
57
 
58
  struct space_info {
59
  uintmax_t capacity;
60
  uintmax_t free;
61
  uintmax_t available;
 
 
62
  };
63
 
64
  // [fs.enum], enumerations
65
  enum class file_type;
66
  enum class perms;
67
  enum class perm_options;
68
  enum class copy_options;
69
  enum class directory_options;
70
 
71
- using file_time_type = chrono::time_point<trivial-clock>;
72
 
73
  // [fs.op.funcs], filesystem operations
74
- path absolute(const path& p, const path& base = current_path());
 
75
 
76
- path canonical(const path& p, const path& base = current_path());
77
  path canonical(const path& p, error_code& ec);
78
- path canonical(const path& p, const path& base, error_code& ec);
79
 
80
  void copy(const path& from, const path& to);
81
- void copy(const path& from, const path& to, error_code& ec) noexcept;
82
  void copy(const path& from, const path& to, copy_options options);
83
  void copy(const path& from, const path& to, copy_options options,
84
- error_code& ec) noexcept;
85
 
86
  bool copy_file(const path& from, const path& to);
87
- bool copy_file(const path& from, const path& to, error_code& ec) noexcept;
88
  bool copy_file(const path& from, const path& to, copy_options option);
89
  bool copy_file(const path& from, const path& to, copy_options option,
90
- error_code& ec) noexcept;
91
 
92
  void copy_symlink(const path& existing_symlink, const path& new_symlink);
93
  void copy_symlink(const path& existing_symlink, const path& new_symlink,
94
  error_code& ec) noexcept;
95
 
96
  bool create_directories(const path& p);
97
- bool create_directories(const path& p, error_code& ec) noexcept;
98
 
99
  bool create_directory(const path& p);
100
  bool create_directory(const path& p, error_code& ec) noexcept;
101
 
102
  bool create_directory(const path& p, const path& attributes);
@@ -118,17 +99,17 @@ namespace std::filesystem {
118
  path current_path();
119
  path current_path(error_code& ec);
120
  void current_path(const path& p);
121
  void current_path(const path& p, error_code& ec) noexcept;
122
 
 
 
 
123
  bool exists(file_status s) noexcept;
124
  bool exists(const path& p);
125
  bool exists(const path& p, error_code& ec) noexcept;
126
 
127
- bool equivalent(const path& p1, const path& p2);
128
- bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
129
-
130
  uintmax_t file_size(const path& p);
131
  uintmax_t file_size(const path& p, error_code& ec) noexcept;
132
 
133
  uintmax_t hard_link_count(const path& p);
134
  uintmax_t hard_link_count(const path& p, error_code& ec) noexcept;
@@ -144,11 +125,11 @@ namespace std::filesystem {
144
  bool is_directory(file_status s) noexcept;
145
  bool is_directory(const path& p);
146
  bool is_directory(const path& p, error_code& ec) noexcept;
147
 
148
  bool is_empty(const path& p);
149
- bool is_empty(const path& p, error_code& ec) noexcept;
150
 
151
  bool is_fifo(file_status s) noexcept;
152
  bool is_fifo(const path& p);
153
  bool is_fifo(const path& p, error_code& ec) noexcept;
154
 
@@ -191,11 +172,11 @@ namespace std::filesystem {
191
 
192
  bool remove(const path& p);
193
  bool remove(const path& p, error_code& ec) noexcept;
194
 
195
  uintmax_t remove_all(const path& p);
196
- uintmax_t remove_all(const path& p, error_code& ec) noexcept;
197
 
198
  void rename(const path& from, const path& to);
199
  void rename(const path& from, const path& to, error_code& ec) noexcept;
200
 
201
  void resize_file(const path& p, uintmax_t size);
@@ -218,11 +199,9 @@ namespace std::filesystem {
218
  path weakly_canonical(const path& p);
219
  path weakly_canonical(const path& p, error_code& ec);
220
  }
221
  ```
222
 
223
- `trivial-clock` is an *implementation-defined* type that satisfies the
224
- `TrivialClock` requirements ([[time.clock.req]]) and that is capable of
225
- representing and measuring file time values. Implementations should
226
- ensure that the resolution and range of `file_time_type` reflect the
227
- operating system dependent resolution and range of file time values.
228
 
 
1
  ### Header `<filesystem>` synopsis <a id="fs.filesystem.syn">[[fs.filesystem.syn]]</a>
2
 
3
  ``` cpp
4
+ #include <compare> // see [compare.syn]
5
+
6
  namespace std::filesystem {
7
  // [fs.class.path], paths
8
  class path;
9
 
10
  // [fs.path.nonmember], path non-member functions
11
  void swap(path& lhs, path& rhs) noexcept;
12
  size_t hash_value(const path& p) noexcept;
13
 
14
+ // [fs.class.filesystem.error], filesystem errors
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  class filesystem_error;
16
 
17
+ // [fs.class.directory.entry], directory entries
18
  class directory_entry;
19
 
20
+ // [fs.class.directory.iterator], directory iterators
21
  class directory_iterator;
22
 
23
  // [fs.dir.itr.nonmembers], range access for directory iterators
24
  directory_iterator begin(directory_iterator iter) noexcept;
25
  directory_iterator end(const directory_iterator&) noexcept;
 
29
 
30
  // [fs.rec.dir.itr.nonmembers], range access for recursive directory iterators
31
  recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
32
  recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
33
 
34
+ // [fs.class.file.status], file status
35
  class file_status;
36
 
37
  struct space_info {
38
  uintmax_t capacity;
39
  uintmax_t free;
40
  uintmax_t available;
41
+
42
+ friend bool operator==(const space_info&, const space_info&) = default;
43
  };
44
 
45
  // [fs.enum], enumerations
46
  enum class file_type;
47
  enum class perms;
48
  enum class perm_options;
49
  enum class copy_options;
50
  enum class directory_options;
51
 
52
+ using file_time_type = chrono::time_point<chrono::file_clock>;
53
 
54
  // [fs.op.funcs], filesystem operations
55
+ path absolute(const path& p);
56
+ path absolute(const path& p, error_code& ec);
57
 
58
+ path canonical(const path& p);
59
  path canonical(const path& p, error_code& ec);
 
60
 
61
  void copy(const path& from, const path& to);
62
+ void copy(const path& from, const path& to, error_code& ec);
63
  void copy(const path& from, const path& to, copy_options options);
64
  void copy(const path& from, const path& to, copy_options options,
65
+ error_code& ec);
66
 
67
  bool copy_file(const path& from, const path& to);
68
+ bool copy_file(const path& from, const path& to, error_code& ec);
69
  bool copy_file(const path& from, const path& to, copy_options option);
70
  bool copy_file(const path& from, const path& to, copy_options option,
71
+ error_code& ec);
72
 
73
  void copy_symlink(const path& existing_symlink, const path& new_symlink);
74
  void copy_symlink(const path& existing_symlink, const path& new_symlink,
75
  error_code& ec) noexcept;
76
 
77
  bool create_directories(const path& p);
78
+ bool create_directories(const path& p, error_code& ec);
79
 
80
  bool create_directory(const path& p);
81
  bool create_directory(const path& p, error_code& ec) noexcept;
82
 
83
  bool create_directory(const path& p, const path& attributes);
 
99
  path current_path();
100
  path current_path(error_code& ec);
101
  void current_path(const path& p);
102
  void current_path(const path& p, error_code& ec) noexcept;
103
 
104
+ bool equivalent(const path& p1, const path& p2);
105
+ bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
106
+
107
  bool exists(file_status s) noexcept;
108
  bool exists(const path& p);
109
  bool exists(const path& p, error_code& ec) noexcept;
110
 
 
 
 
111
  uintmax_t file_size(const path& p);
112
  uintmax_t file_size(const path& p, error_code& ec) noexcept;
113
 
114
  uintmax_t hard_link_count(const path& p);
115
  uintmax_t hard_link_count(const path& p, error_code& ec) noexcept;
 
125
  bool is_directory(file_status s) noexcept;
126
  bool is_directory(const path& p);
127
  bool is_directory(const path& p, error_code& ec) noexcept;
128
 
129
  bool is_empty(const path& p);
130
+ bool is_empty(const path& p, error_code& ec);
131
 
132
  bool is_fifo(file_status s) noexcept;
133
  bool is_fifo(const path& p);
134
  bool is_fifo(const path& p, error_code& ec) noexcept;
135
 
 
172
 
173
  bool remove(const path& p);
174
  bool remove(const path& p, error_code& ec) noexcept;
175
 
176
  uintmax_t remove_all(const path& p);
177
+ uintmax_t remove_all(const path& p, error_code& ec);
178
 
179
  void rename(const path& from, const path& to);
180
  void rename(const path& from, const path& to, error_code& ec) noexcept;
181
 
182
  void resize_file(const path& p, uintmax_t size);
 
199
  path weakly_canonical(const path& p);
200
  path weakly_canonical(const path& p, error_code& ec);
201
  }
202
  ```
203
 
204
+ Implementations should ensure that the resolution and range of
205
+ `file_time_type` reflect the operating system dependent resolution and
206
+ range of file time values.
 
 
207