From Jason Turner

[fs.path.fmtr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4ly__de3/{from.md → to.md} +69 -0
tmp/tmp4ly__de3/{from.md → to.md} RENAMED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Formatting support <a id="fs.path.fmtr">[[fs.path.fmtr]]</a>
2
+
3
+ ##### Formatting support overview <a id="fs.path.fmtr.general">[[fs.path.fmtr.general]]</a>
4
+
5
+ ``` cpp
6
+ namespace std {
7
+ template<class charT> struct formatter<filesystem::path, charT> {
8
+ constexpr void set_debug_format();
9
+
10
+ constexpr typename basic_format_parse_context<charT>::iterator
11
+ parse(basic_format_parse_context<charT>& ctx);
12
+
13
+ template<class FormatContext>
14
+ typename FormatContext::iterator
15
+ format(const filesystem::path& path, FormatContext& ctx) const;
16
+ };
17
+ }
18
+ ```
19
+
20
+ ##### Formatting support functions <a id="fs.path.fmtr.funcs">[[fs.path.fmtr.funcs]]</a>
21
+
22
+ Formatting of paths uses formatting specifiers of the form
23
+
24
+ ``` bnf
25
+ path-format-spec:
26
+ fill-and-alignₒₚₜ widthₒₚₜ '?'ₒₚₜ 'g'ₒₚₜ
27
+ ```
28
+
29
+ where the productions *fill-and-align* and *width* are described in
30
+ [[format.string]]. If the `?` option is used then the path is formatted
31
+ as an escaped string [[format.string.escaped]].
32
+
33
+ ``` cpp
34
+ constexpr void set_debug_format();
35
+ ```
36
+
37
+ *Effects:* Modifies the state of the `formatter` to be as if the
38
+ *path-format-spec* parsed by the last call to `parse` contained the `?`
39
+ option.
40
+
41
+ ``` cpp
42
+ constexpr typename basic_format_parse_context<charT>::iterator
43
+ parse(basic_format_parse_context<charT>& ctx);
44
+ ```
45
+
46
+ *Effects:* Parses the format specifier as a *path-format-spec* and
47
+ stores the parsed specifiers in `*this`.
48
+
49
+ *Returns:* An iterator past the end of the *path-format-spec*.
50
+
51
+ ``` cpp
52
+ template<class FormatContext>
53
+ typename FormatContext::iterator
54
+ format(const filesystem::path& p, FormatContext& ctx) const;
55
+ ```
56
+
57
+ *Effects:* Let `s` be `p.generic_string<filesystem::path::value_type>()`
58
+ if the `g` option is used, otherwise `p.native()`. Writes `s` into
59
+ `ctx.out()`, adjusted according to the *path-format-spec*. If `charT` is
60
+ `char`, `path::value_type` is `wchar_t`, and the literal encoding is
61
+ UTF-8, then the escaped path is transcoded from the native encoding for
62
+ wide character strings to UTF-8 with maximal subparts of ill-formed
63
+ subsequences substituted with ‘U+fffd‘ replacement character per the
64
+ Unicode Standard, Chapter 3.9 ‘U+fffd‘ Substitution in Conversion. If
65
+ `charT` and `path::value_type` are the same then no transcoding is
66
+ performed. Otherwise, transcoding is *implementation-defined*.
67
+
68
+ *Returns:* An iterator past the end of the output range.
69
+