tmp/tmp7sodhs42/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 this
|
| 22 |
+
subclause.
|
| 23 |
+
|
| 24 |
+
#### `filesystem_error` members <a id="filesystem_error.members">[[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 |
+
*Postconditions:* The postconditions of this function are indicated in
|
| 34 |
+
Table [[tab:filesystem_error.1]].
|
| 35 |
+
|
| 36 |
+
**Table: `filesystem_error(const string&, error_code)` effects** <a id="tab:filesystem_error.1">[tab:filesystem_error.1]</a>
|
| 37 |
+
|
| 38 |
+
| Expression | Value |
|
| 39 |
+
| ----------------------- | ------------------ |
|
| 40 |
+
| `runtime_error::what()` | `what_arg.c_str()` |
|
| 41 |
+
| `code()` | `ec` |
|
| 42 |
+
| `path1().empty()` | `true` |
|
| 43 |
+
| `path2().empty()` | `true` |
|
| 44 |
+
|
| 45 |
+
``` cpp
|
| 46 |
+
filesystem_error(const string& what_arg, const path& p1, error_code ec);
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
*Postconditions:* The postconditions of this function are indicated in
|
| 50 |
+
Table [[tab:filesystem_error.2]].
|
| 51 |
+
|
| 52 |
+
**Table: `filesystem_error(const string&, const path&, error_code)` effects** <a id="tab:filesystem_error.2">[tab:filesystem_error.2]</a>
|
| 53 |
+
|
| 54 |
+
| Expression | Value |
|
| 55 |
+
| ----------------------- | -------------------------------- |
|
| 56 |
+
| `runtime_error::what()` | `what_arg.c_str()` |
|
| 57 |
+
| `code()` | `ec` |
|
| 58 |
+
| `path1()` | Reference to stored copy of `p1` |
|
| 59 |
+
| `path2().empty()` | `true` |
|
| 60 |
+
|
| 61 |
+
``` cpp
|
| 62 |
+
filesystem_error(const string& what_arg, const path& p1, const path& p2, error_code ec);
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
*Postconditions:* The postconditions of this function are indicated in
|
| 66 |
+
Table [[tab:filesystem_error.3]].
|
| 67 |
+
|
| 68 |
+
**Table: `filesystem_error(const string&, const path&, const path&, error_code)` effects** <a id="tab:filesystem_error.3">[tab:filesystem_error.3]</a>
|
| 69 |
+
|
| 70 |
+
| Expression | Value |
|
| 71 |
+
| ----------------------- | -------------------------------- |
|
| 72 |
+
| `runtime_error::what()` | `what_arg.c_str()` |
|
| 73 |
+
| `code()` | `ec` |
|
| 74 |
+
| `path1()` | Reference to stored copy of `p1` |
|
| 75 |
+
| `path2()` | Reference to stored copy of `p2` |
|
| 76 |
+
|
| 77 |
+
``` cpp
|
| 78 |
+
const path& path1() const noexcept;
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
*Returns:* A reference to the copy of `p1` stored by the constructor,
|
| 82 |
+
or, if none, an empty path.
|
| 83 |
+
|
| 84 |
+
``` cpp
|
| 85 |
+
const path& path2() const noexcept;
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
*Returns:* A reference to the copy of `p2` stored by the constructor,
|
| 89 |
+
or, if none, an empty path.
|
| 90 |
+
|
| 91 |
+
``` cpp
|
| 92 |
+
const char* what() const noexcept override;
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
*Returns:* A string containing `runtime_error::what()`. The exact format
|
| 96 |
+
is unspecified. Implementations are encouraged but not required to
|
| 97 |
+
include `path1.native_string()` if not empty, `path2.native_string()` if
|
| 98 |
+
not empty, and `system_error::what()` strings in the returned string.
|
| 99 |
+
|