From Jason Turner

[fs.class.filesystem.error]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4k2rtglg/{from.md → to.md} +84 -0
tmp/tmp4k2rtglg/{from.md → to.md} RENAMED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Class `filesystem_error` <a id="fs.class.filesystem.error">[[fs.class.filesystem.error]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::filesystem {
5
+ class filesystem_error : public system_error {
6
+ public:
7
+ filesystem_error(const string& what_arg, error_code ec);
8
+ filesystem_error(const string& what_arg,
9
+ const path& p1, error_code ec);
10
+ filesystem_error(const string& what_arg,
11
+ const path& p1, const path& p2, error_code ec);
12
+
13
+ const path& path1() const noexcept;
14
+ const path& path2() const noexcept;
15
+ const char* what() const noexcept override;
16
+ };
17
+ }
18
+ ```
19
+
20
+ The class `filesystem_error` defines the type of objects thrown as
21
+ exceptions to report file system errors from functions described in
22
+ subclause  [[filesystems]].
23
+
24
+ #### Members <a id="fs.filesystem.error.members">[[fs.filesystem.error.members]]</a>
25
+
26
+ Constructors are provided that store zero, one, or two paths associated
27
+ with an error.
28
+
29
+ ``` cpp
30
+ filesystem_error(const string& what_arg, error_code ec);
31
+ ```
32
+
33
+ *Ensures:*
34
+
35
+ - `code() == ec`,
36
+ - `path1().empty() == true`,
37
+ - `path2().empty() == true`, and
38
+ - `string_view(what()).find(what_arg.c_str())` `!= string_view::npos`.
39
+
40
+ ``` cpp
41
+ filesystem_error(const string& what_arg, const path& p1, error_code ec);
42
+ ```
43
+
44
+ *Ensures:*
45
+
46
+ - `code() == ec`,
47
+ - `path1()` returns a reference to the stored copy of `p1`,
48
+ - `path2().empty() == true`, and
49
+ - `string_view(what()).find(what_arg.c_str())` `!= string_view::npos`.
50
+
51
+ ``` cpp
52
+ filesystem_error(const string& what_arg, const path& p1, const path& p2, error_code ec);
53
+ ```
54
+
55
+ *Ensures:*
56
+
57
+ - `code() == ec`,
58
+ - `path1()` returns a reference to the stored copy of `p1`,
59
+ - `path2()` returns a reference to the stored copy of `p2`, and
60
+ - `string_view(what()).find(what_arg.c_str())` `!= string_view::npos`.
61
+
62
+ ``` cpp
63
+ const path& path1() const noexcept;
64
+ ```
65
+
66
+ *Returns:* A reference to the copy of `p1` stored by the constructor,
67
+ or, if none, an empty path.
68
+
69
+ ``` cpp
70
+ const path& path2() const noexcept;
71
+ ```
72
+
73
+ *Returns:* A reference to the copy of `p2` stored by the constructor,
74
+ or, if none, an empty path.
75
+
76
+ ``` cpp
77
+ const char* what() const noexcept override;
78
+ ```
79
+
80
+ *Returns:* An NTBS that incorporates the `what_arg` argument supplied to
81
+ the constructor. The exact format is unspecified. Implementations should
82
+ include the `system_error::what()` string and the pathnames of `path1`
83
+ and `path2` in the native format in the returned string.
84
+