tmp/tmp21r68e6l/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
-
#####
|
| 4 |
|
| 5 |
[*Note 1*:
|
| 6 |
|
| 7 |
-
The format conversions described in this
|
| 8 |
POSIX-based operating systems because on these systems:
|
| 9 |
|
| 10 |
- The generic format is acceptable as a native path.
|
| 11 |
- There is no need to distinguish between native format and generic
|
| 12 |
format in function arguments.
|
|
@@ -15,15 +15,15 @@ POSIX-based operating systems because on these systems:
|
|
| 15 |
|
| 16 |
— *end note*]
|
| 17 |
|
| 18 |
Several functions are defined to accept *detected-format* arguments,
|
| 19 |
which are character sequences. A detected-format argument represents a
|
| 20 |
-
path using either a pathname in the generic format
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
format
|
| 24 |
-
|
| 25 |
|
| 26 |
[*Note 2*: Some operating systems may have no unambiguous way to
|
| 27 |
distinguish between native format and generic format arguments. This is
|
| 28 |
by design as it simplifies use for operating systems that do not require
|
| 29 |
disambiguation. An implementation for an operating system where
|
|
@@ -42,12 +42,12 @@ native-to-generic and generic-to-native formats respectively. If
|
|
| 42 |
If the native format requires paths for regular files to be formatted
|
| 43 |
differently from paths for directories, the path shall be treated as a
|
| 44 |
directory path if its last element is a *directory-separator*, otherwise
|
| 45 |
it shall be treated as a path to a regular file.
|
| 46 |
|
| 47 |
-
[*Note 4*: A path stores a native format pathname
|
| 48 |
-
[[fs.path.native.obs]]
|
| 49 |
pathname, related as given below. The implementation may generate the
|
| 50 |
generic format pathname based on the native format pathname (and
|
| 51 |
possibly other information) when requested. — *end note*]
|
| 52 |
|
| 53 |
When a path is constructed from or is assigned a single representation
|
|
@@ -60,36 +60,43 @@ the other representation. The value *q* converts to *p* (by *G* or *N*
|
|
| 60 |
as appropriate) if any such value does so; *q* is otherwise unspecified.
|
| 61 |
|
| 62 |
[*Note 5*: If *q* is the result of converting any path at all, it is
|
| 63 |
the result of converting *p*. — *end note*]
|
| 64 |
|
| 65 |
-
#####
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
For member function arguments that take character sequences representing
|
| 68 |
paths and for member functions returning strings, value type and
|
| 69 |
encoding conversion is performed if the value type of the argument or
|
| 70 |
return value differs from `path::value_type`. For the argument or return
|
| 71 |
value, the method of conversion and the encoding to be converted to is
|
| 72 |
determined by its value type:
|
| 73 |
|
| 74 |
-
- `char`: The encoding is the native
|
| 75 |
-
|
| 76 |
-
operating
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
encoding is determined by calling a Windows API
|
| 81 |
function. — *end note*] \[*Note 7*: This results in behavior
|
| 82 |
identical to other C and C++ standard library functions that perform
|
| 83 |
-
file operations using
|
| 84 |
Changing this behavior would be surprising and error
|
| 85 |
prone. — *end note*]
|
| 86 |
-
- `wchar_t`: The encoding is the native wide encoding
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
`wchar_t`
|
| 90 |
-
|
|
|
|
|
|
|
| 91 |
- `char16_t`: The encoding is UTF-16. The method of conversion is
|
| 92 |
unspecified.
|
| 93 |
- `char32_t`: The encoding is UTF-32. The method of conversion is
|
| 94 |
unspecified.
|
| 95 |
|
|
|
|
| 1 |
+
#### Conversions <a id="fs.path.cvt">[[fs.path.cvt]]</a>
|
| 2 |
|
| 3 |
+
##### Argument format conversions <a id="fs.path.fmt.cvt">[[fs.path.fmt.cvt]]</a>
|
| 4 |
|
| 5 |
[*Note 1*:
|
| 6 |
|
| 7 |
+
The format conversions described in this subclause are not applied on
|
| 8 |
POSIX-based operating systems because on these systems:
|
| 9 |
|
| 10 |
- The generic format is acceptable as a native path.
|
| 11 |
- There is no need to distinguish between native format and generic
|
| 12 |
format in function arguments.
|
|
|
|
| 15 |
|
| 16 |
— *end note*]
|
| 17 |
|
| 18 |
Several functions are defined to accept *detected-format* arguments,
|
| 19 |
which are character sequences. A detected-format argument represents a
|
| 20 |
+
path using either a pathname in the generic format [[fs.path.generic]]
|
| 21 |
+
or a pathname in the native format [[fs.class.path]]. Such an argument
|
| 22 |
+
is taken to be in the generic format if and only if it matches the
|
| 23 |
+
generic format and is not acceptable to the operating system as a native
|
| 24 |
+
path.
|
| 25 |
|
| 26 |
[*Note 2*: Some operating systems may have no unambiguous way to
|
| 27 |
distinguish between native format and generic format arguments. This is
|
| 28 |
by design as it simplifies use for operating systems that do not require
|
| 29 |
disambiguation. An implementation for an operating system where
|
|
|
|
| 42 |
If the native format requires paths for regular files to be formatted
|
| 43 |
differently from paths for directories, the path shall be treated as a
|
| 44 |
directory path if its last element is a *directory-separator*, otherwise
|
| 45 |
it shall be treated as a path to a regular file.
|
| 46 |
|
| 47 |
+
[*Note 4*: A path stores a native format pathname
|
| 48 |
+
[[fs.path.native.obs]] and acts as if it also stores a generic format
|
| 49 |
pathname, related as given below. The implementation may generate the
|
| 50 |
generic format pathname based on the native format pathname (and
|
| 51 |
possibly other information) when requested. — *end note*]
|
| 52 |
|
| 53 |
When a path is constructed from or is assigned a single representation
|
|
|
|
| 60 |
as appropriate) if any such value does so; *q* is otherwise unspecified.
|
| 61 |
|
| 62 |
[*Note 5*: If *q* is the result of converting any path at all, it is
|
| 63 |
the result of converting *p*. — *end note*]
|
| 64 |
|
| 65 |
+
##### Type and encoding conversions <a id="fs.path.type.cvt">[[fs.path.type.cvt]]</a>
|
| 66 |
+
|
| 67 |
+
The *native encoding* of an ordinary character string is the operating
|
| 68 |
+
system dependent current encoding for pathnames [[fs.class.path]]. The
|
| 69 |
+
*native encoding* for wide character strings is the
|
| 70 |
+
implementation-defined execution wide-character set encoding
|
| 71 |
+
[[lex.charset]].
|
| 72 |
|
| 73 |
For member function arguments that take character sequences representing
|
| 74 |
paths and for member functions returning strings, value type and
|
| 75 |
encoding conversion is performed if the value type of the argument or
|
| 76 |
return value differs from `path::value_type`. For the argument or return
|
| 77 |
value, the method of conversion and the encoding to be converted to is
|
| 78 |
determined by its value type:
|
| 79 |
|
| 80 |
+
- `char`: The encoding is the native ordinary encoding. The method of
|
| 81 |
+
conversion, if any, is operating system dependent. \[*Note 6*: For
|
| 82 |
+
POSIX-based operating systems `path::value_type` is `char` so no
|
| 83 |
+
conversion from `char` value type arguments or to `char` value type
|
| 84 |
+
return values is performed. For Windows-based operating systems, the
|
| 85 |
+
native ordinary encoding is determined by calling a Windows API
|
|
|
|
| 86 |
function. — *end note*] \[*Note 7*: This results in behavior
|
| 87 |
identical to other C and C++ standard library functions that perform
|
| 88 |
+
file operations using ordinary character strings to identify paths.
|
| 89 |
Changing this behavior would be surprising and error
|
| 90 |
prone. — *end note*]
|
| 91 |
+
- `wchar_t`: The encoding is the native wide encoding. The method of
|
| 92 |
+
conversion is unspecified. \[*Note 8*: For Windows-based operating
|
| 93 |
+
systems `path::value_type` is `wchar_t` so no conversion from
|
| 94 |
+
`wchar_t` value type arguments or to `wchar_t` value type return
|
| 95 |
+
values is performed. — *end note*]
|
| 96 |
+
- `char8_t`: The encoding is UTF-8. The method of conversion is
|
| 97 |
+
unspecified.
|
| 98 |
- `char16_t`: The encoding is UTF-16. The method of conversion is
|
| 99 |
unspecified.
|
| 100 |
- `char32_t`: The encoding is UTF-32. The method of conversion is
|
| 101 |
unspecified.
|
| 102 |
|