tmp/tmpn1mqgpdz/{from.md → to.md}
RENAMED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
-
#####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
path() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
-
*
|
| 8 |
-
|
| 9 |
-
*Postconditions:* `empty() == true`.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
path(const path& p);
|
| 13 |
path(path&& p) noexcept;
|
| 14 |
```
|
|
@@ -21,49 +19,48 @@ state.
|
|
| 21 |
``` cpp
|
| 22 |
path(string_type&& source, format fmt = auto_format);
|
| 23 |
```
|
| 24 |
|
| 25 |
*Effects:* Constructs an object of class `path` for which the pathname
|
| 26 |
-
in the detected-format of `source` has the original value of
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
unspecified state.
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
template<class Source>
|
| 33 |
path(const Source& source, format fmt = auto_format);
|
| 34 |
template<class InputIterator>
|
| 35 |
path(InputIterator first, InputIterator last, format fmt = auto_format);
|
| 36 |
```
|
| 37 |
|
| 38 |
-
*Effects:* Let `s` be the effective range of `source`
|
| 39 |
-
|
| 40 |
-
required
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
template<class Source>
|
| 46 |
path(const Source& source, const locale& loc, format fmt = auto_format);
|
| 47 |
template<class InputIterator>
|
| 48 |
path(InputIterator first, InputIterator last, const locale& loc, format fmt = auto_format);
|
| 49 |
```
|
| 50 |
|
| 51 |
-
*
|
| 52 |
|
| 53 |
*Effects:* Let `s` be the effective range of `source` or the range
|
| 54 |
\[`first`, `last`), after converting the encoding as follows:
|
| 55 |
|
| 56 |
- If `value_type` is `wchar_t`, converts to the native wide
|
| 57 |
-
encoding
|
| 58 |
`codecvt<wchar_t, char, mbstate_t>` facet of `loc`.
|
| 59 |
- Otherwise a conversion is performed using the
|
| 60 |
`codecvt<wchar_t, char, mbstate_t>` facet of `loc`, and then a second
|
| 61 |
-
conversion to the current
|
| 62 |
|
| 63 |
-
Finds the detected-format of `s`
|
| 64 |
-
|
| 65 |
|
| 66 |
[*Example 1*:
|
| 67 |
|
| 68 |
A string is to be read from a database that is encoded in ISO/IEC
|
| 69 |
8859-1, and used to create a directory:
|
|
@@ -77,16 +74,16 @@ fs::create_directory(fs::path(latin1_string, latin1_locale));
|
|
| 77 |
```
|
| 78 |
|
| 79 |
For POSIX-based operating systems, the path is constructed by first
|
| 80 |
using `latin1_facet` to convert ISO/IEC 8859-1 encoded `latin1_string`
|
| 81 |
to a wide character string in the native wide
|
| 82 |
-
encoding
|
| 83 |
-
converted to
|
| 84 |
-
|
| 85 |
-
the current native
|
| 86 |
the ISO/IEC 8859-1 character set will be converted to their Unicode
|
| 87 |
-
representation, but for other native
|
| 88 |
may have no representation.
|
| 89 |
|
| 90 |
For Windows-based operating systems, the path is constructed by using
|
| 91 |
`latin1_facet` to convert ISO/IEC 8859-1 encoded `latin1_string` to a
|
| 92 |
UTF-16 encoded wide character pathname string. All of the characters in
|
|
|
|
| 1 |
+
##### Constructors <a id="fs.path.construct">[[fs.path.construct]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
path() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
+
*Ensures:* `empty() == true`.
|
|
|
|
|
|
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
path(const path& p);
|
| 11 |
path(path&& p) noexcept;
|
| 12 |
```
|
|
|
|
| 19 |
``` cpp
|
| 20 |
path(string_type&& source, format fmt = auto_format);
|
| 21 |
```
|
| 22 |
|
| 23 |
*Effects:* Constructs an object of class `path` for which the pathname
|
| 24 |
+
in the detected-format of `source` has the original value of `source`
|
| 25 |
+
[[fs.path.fmt.cvt]], converting format if required [[fs.path.fmt.cvt]].
|
| 26 |
+
`source` is left in a valid but unspecified state.
|
|
|
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
template<class Source>
|
| 30 |
path(const Source& source, format fmt = auto_format);
|
| 31 |
template<class InputIterator>
|
| 32 |
path(InputIterator first, InputIterator last, format fmt = auto_format);
|
| 33 |
```
|
| 34 |
|
| 35 |
+
*Effects:* Let `s` be the effective range of `source` [[fs.path.req]] or
|
| 36 |
+
the range \[`first`, `last`), with the encoding converted if
|
| 37 |
+
required [[fs.path.cvt]]. Finds the detected-format of `s`
|
| 38 |
+
[[fs.path.fmt.cvt]] and constructs an object of class `path` for which
|
| 39 |
+
the pathname in that format is `s`.
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
template<class Source>
|
| 43 |
path(const Source& source, const locale& loc, format fmt = auto_format);
|
| 44 |
template<class InputIterator>
|
| 45 |
path(InputIterator first, InputIterator last, const locale& loc, format fmt = auto_format);
|
| 46 |
```
|
| 47 |
|
| 48 |
+
*Mandates:* The value type of `Source` and `InputIterator` is `char`.
|
| 49 |
|
| 50 |
*Effects:* Let `s` be the effective range of `source` or the range
|
| 51 |
\[`first`, `last`), after converting the encoding as follows:
|
| 52 |
|
| 53 |
- If `value_type` is `wchar_t`, converts to the native wide
|
| 54 |
+
encoding [[fs.path.type.cvt]] using the
|
| 55 |
`codecvt<wchar_t, char, mbstate_t>` facet of `loc`.
|
| 56 |
- Otherwise a conversion is performed using the
|
| 57 |
`codecvt<wchar_t, char, mbstate_t>` facet of `loc`, and then a second
|
| 58 |
+
conversion to the current ordinary encoding.
|
| 59 |
|
| 60 |
+
Finds the detected-format of `s` [[fs.path.fmt.cvt]] and constructs an
|
| 61 |
+
object of class `path` for which the pathname in that format is `s`.
|
| 62 |
|
| 63 |
[*Example 1*:
|
| 64 |
|
| 65 |
A string is to be read from a database that is encoded in ISO/IEC
|
| 66 |
8859-1, and used to create a directory:
|
|
|
|
| 74 |
```
|
| 75 |
|
| 76 |
For POSIX-based operating systems, the path is constructed by first
|
| 77 |
using `latin1_facet` to convert ISO/IEC 8859-1 encoded `latin1_string`
|
| 78 |
to a wide character string in the native wide
|
| 79 |
+
encoding [[fs.path.type.cvt]]. The resulting wide string is then
|
| 80 |
+
converted to an ordinary character pathname string in the current native
|
| 81 |
+
ordinary encoding. If the native wide encoding is UTF-16 or UTF-32, and
|
| 82 |
+
the current native ordinary encoding is UTF-8, all of the characters in
|
| 83 |
the ISO/IEC 8859-1 character set will be converted to their Unicode
|
| 84 |
+
representation, but for other native ordinary encodings some characters
|
| 85 |
may have no representation.
|
| 86 |
|
| 87 |
For Windows-based operating systems, the path is constructed by using
|
| 88 |
`latin1_facet` to convert ISO/IEC 8859-1 encoded `latin1_string` to a
|
| 89 |
UTF-16 encoded wide character pathname string. All of the characters in
|