This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,139 @@
[fs.filesystem.error.members]
# 31 Input/output library [[input.output]](./#input.output)
## 31.12 File systems [[filesystems]](filesystems#fs.filesystem.error.members)
### 31.12.7 Class filesystem_error [[fs.class.filesystem.error]](fs.class.filesystem.error#fs.filesystem.error.members)
#### 31.12.7.2 Members [fs.filesystem.error.members]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15598)
Constructors are provided that store zero, one, or two paths associated with
an error[.](#1.sentence-1)
[🔗](#lib:filesystem_error,constructor)
`filesystem_error(const string& what_arg, error_code ec);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15608)
*Postconditions*:
- [(2.1)](#2.1)
code() == ec is true,
- [(2.2)](#2.2)
path1().empty() is true,
- [(2.3)](#2.3)
path2().empty() is true, and
- [(2.4)](#2.4)
string_view(what()).find(what_arg.c_str()) != string_view::npos is true[.](#2.sentence-1)
[🔗](#lib:filesystem_error,constructor_)
`filesystem_error(const string& what_arg, const path& p1, error_code ec);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15624)
*Postconditions*:
- [(3.1)](#3.1)
code() == ec is true,
- [(3.2)](#3.2)
path1() returns a reference to the stored copy of p1,
- [(3.3)](#3.3)
path2().empty() is true, and
- [(3.4)](#3.4)
string_view(what()).find(what_arg.c_str()) != string_view::npos is true[.](#3.sentence-1)
[🔗](#lib:filesystem_error,constructor__)
`filesystem_error(const string& what_arg, const path& p1, const path& p2, error_code ec);
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15640)
*Postconditions*:
- [(4.1)](#4.1)
code() == ec,
- [(4.2)](#4.2)
path1() returns a reference to the stored copy of p1,
- [(4.3)](#4.3)
path2() returns a reference to the stored copy of p2, and
- [(4.4)](#4.4)
string_view(what()).find(what_arg.c_str()) != string_view::npos[.](#4.sentence-1)
[🔗](#lib:path1,filesystem_error)
`const path& path1() const noexcept;
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15656)
*Returns*: A reference to the copy of p1 stored by the
constructor, or, if none, an empty path[.](#5.sentence-1)
[🔗](#lib:path2,filesystem_error)
`const path& path2() const noexcept;
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15668)
*Returns*: A reference to the copy of p2 stored by the
constructor, or, if none, an empty path[.](#6.sentence-1)
[🔗](#lib:what,filesystem_error)
`const char* what() const noexcept override;
`
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15680)
*Returns*: An ntbs that incorporates
the what_arg argument supplied to the constructor[.](#7.sentence-1)
The exact format is unspecified[.](#7.sentence-2)
Implementations should include
the system_error::what() string and
the pathnames of path1 and path2 in the native format in the returned string[.](#7.sentence-3)

View File

@@ -0,0 +1,76 @@
[fs.filesystem.syn]
# 31 Input/output library [[input.output]](./#input.output)
## 31.12 File systems [[filesystems]](filesystems#fs.filesystem.syn)
### 31.12.4 Header <filesystem> synopsis [fs.filesystem.syn]
[🔗](#header:%3cfilesystem%3e)
#include <compare> // see [[compare.syn]](compare.syn "17.12.1Header <compare> synopsis")namespace std::filesystem {// [[fs.class.path]](fs.class.path "31.12.6Class path"), pathsclass path; // [[fs.path.nonmember]](fs.path.nonmember "31.12.6.8Non-member functions"), path non-member functionsvoid swap(path& lhs, path& rhs) noexcept;
size_t hash_value(const path& p) noexcept; // [[fs.class.filesystem.error]](fs.class.filesystem.error "31.12.7Class filesystem_­error"), filesystem errorsclass filesystem_error; // [[fs.class.directory.entry]](fs.class.directory.entry "31.12.10Class directory_­entry"), directory entriesclass directory_entry; // [[fs.class.directory.iterator]](fs.class.directory.iterator "31.12.11Class directory_­iterator"), directory iteratorsclass directory_iterator; // [[fs.dir.itr.nonmembers]](fs.dir.itr.nonmembers "31.12.11.3Non-member functions"), range access for directory iterators directory_iterator begin(directory_iterator iter) noexcept;
directory_iterator end(directory_iterator) noexcept; // [[fs.class.rec.dir.itr]](fs.class.rec.dir.itr "31.12.12Class recursive_­directory_­iterator"), recursive directory iteratorsclass recursive_directory_iterator; // [[fs.rec.dir.itr.nonmembers]](fs.rec.dir.itr.nonmembers "31.12.12.3Non-member functions"), range access for recursive directory iterators recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
recursive_directory_iterator end(recursive_directory_iterator) noexcept; // [[fs.class.file.status]](fs.class.file.status "31.12.9Class file_­status"), file statusclass file_status; struct space_info { uintmax_t capacity;
uintmax_t free;
uintmax_t available; friend bool operator==(const space_info&, const space_info&) = default; }; // [[fs.enum]](fs.enum "31.12.8Enumerations"), enumerationsenum class file_type; enum class perms; enum class perm_options; enum class copy_options; enum class directory_options; using file_time_type = chrono::time_point<chrono::file_clock>; // [[fs.op.funcs]](fs.op.funcs "31.12.13Filesystem operation functions"), filesystem operations path absolute(const path& p);
path absolute(const path& p, error_code& ec);
path canonical(const path& p);
path canonical(const path& p, error_code& ec); void copy(const path& from, const path& to); void copy(const path& from, const path& to, error_code& ec); void copy(const path& from, const path& to, copy_options options); void copy(const path& from, const path& to, copy_options options,
error_code& ec); bool copy_file(const path& from, const path& to); bool copy_file(const path& from, const path& to, error_code& ec); bool copy_file(const path& from, const path& to, copy_options option); bool copy_file(const path& from, const path& to, copy_options option,
error_code& ec); void copy_symlink(const path& existing_symlink, const path& new_symlink); void copy_symlink(const path& existing_symlink, const path& new_symlink,
error_code& ec) noexcept; bool create_directories(const path& p); bool create_directories(const path& p, error_code& ec); bool create_directory(const path& p); bool create_directory(const path& p, error_code& ec) noexcept; bool create_directory(const path& p, const path& attributes); bool create_directory(const path& p, const path& attributes,
error_code& ec) noexcept; void create_directory_symlink(const path& to, const path& new_symlink); void create_directory_symlink(const path& to, const path& new_symlink,
error_code& ec) noexcept; void create_hard_link(const path& to, const path& new_hard_link); void create_hard_link(const path& to, const path& new_hard_link,
error_code& ec) noexcept; void create_symlink(const path& to, const path& new_symlink); void create_symlink(const path& to, const path& new_symlink,
error_code& ec) noexcept;
path current_path();
path current_path(error_code& ec); void current_path(const path& p); void current_path(const path& p, error_code& ec) noexcept; bool equivalent(const path& p1, const path& p2); bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept; bool exists(file_status s) noexcept; bool exists(const path& p); bool exists(const path& p, error_code& ec) noexcept;
uintmax_t file_size(const path& p);
uintmax_t file_size(const path& p, error_code& ec) noexcept;
uintmax_t hard_link_count(const path& p);
uintmax_t hard_link_count(const path& p, error_code& ec) noexcept; bool is_block_file(file_status s) noexcept; bool is_block_file(const path& p); bool is_block_file(const path& p, error_code& ec) noexcept; bool is_character_file(file_status s) noexcept; bool is_character_file(const path& p); bool is_character_file(const path& p, error_code& ec) noexcept; bool is_directory(file_status s) noexcept; bool is_directory(const path& p); bool is_directory(const path& p, error_code& ec) noexcept; bool is_empty(const path& p); bool is_empty(const path& p, error_code& ec); bool is_fifo(file_status s) noexcept; bool is_fifo(const path& p); bool is_fifo(const path& p, error_code& ec) noexcept; bool is_other(file_status s) noexcept; bool is_other(const path& p); bool is_other(const path& p, error_code& ec) noexcept; bool is_regular_file(file_status s) noexcept; bool is_regular_file(const path& p); bool is_regular_file(const path& p, error_code& ec) noexcept; bool is_socket(file_status s) noexcept; bool is_socket(const path& p); bool is_socket(const path& p, error_code& ec) noexcept; bool is_symlink(file_status s) noexcept; bool is_symlink(const path& p); bool is_symlink(const path& p, error_code& ec) noexcept;
file_time_type last_write_time(const path& p);
file_time_type last_write_time(const path& p, error_code& ec) noexcept; void last_write_time(const path& p, file_time_type new_time); void last_write_time(const path& p, file_time_type new_time,
error_code& ec) noexcept; void permissions(const path& p, perms prms, perm_options opts=perm_options::replace); void permissions(const path& p, perms prms, error_code& ec) noexcept; void permissions(const path& p, perms prms, perm_options opts, error_code& ec);
path proximate(const path& p, error_code& ec);
path proximate(const path& p, const path& base = current_path());
path proximate(const path& p, const path& base, error_code& ec);
path read_symlink(const path& p);
path read_symlink(const path& p, error_code& ec);
path relative(const path& p, error_code& ec);
path relative(const path& p, const path& base = current_path());
path relative(const path& p, const path& base, error_code& ec); bool remove(const path& p); bool remove(const path& p, error_code& ec) noexcept;
uintmax_t remove_all(const path& p);
uintmax_t remove_all(const path& p, error_code& ec); void rename(const path& from, const path& to); void rename(const path& from, const path& to, error_code& ec) noexcept; void resize_file(const path& p, uintmax_t size); void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept;
space_info space(const path& p);
space_info space(const path& p, error_code& ec) noexcept;
file_status status(const path& p);
file_status status(const path& p, error_code& ec) noexcept; bool status_known(file_status s) noexcept;
file_status symlink_status(const path& p);
file_status symlink_status(const path& p, error_code& ec) noexcept;
path temp_directory_path();
path temp_directory_path(error_code& ec);
path weakly_canonical(const path& p);
path weakly_canonical(const path& p, error_code& ec);}namespace std {// [[fs.path.fmtr]](fs.path.fmtr "31.12.6.9Formatting support"), formatting supporttemplate<class charT> struct formatter<filesystem::path, charT>; // [[fs.path.hash]](fs.path.hash "31.12.6.10Hash support"), hash supporttemplate<class T> struct hash; template<> struct hash<filesystem::path>;}namespace std::ranges {template<>inline constexpr bool enable_borrowed_range<filesystem::directory_iterator> = true; template<>inline constexpr bool enable_borrowed_range<filesystem::recursive_directory_iterator> = true; template<>inline constexpr bool enable_view<filesystem::directory_iterator> = true; template<>inline constexpr bool enable_view<filesystem::recursive_directory_iterator> = true;}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L13494)
Implementations should ensure that the resolution and range offile_time_type reflect the operating system dependent resolution and range
of file time values[.](#1.sentence-1)