31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.6 Class path [fs.class.path]

31.12.6.9 Formatting support [fs.path.fmtr]

31.12.6.9.2 Formatting support functions [fs.path.fmtr.funcs]

Formatting of paths uses formatting specifiers of the form
path-format-spec:
fill-and-align width ? g
where the productions fill-and-align and width are described in [format.string].
If the ? option is used then the path is formatted as an escaped string ([format.string.escaped]).
constexpr void set_debug_format();
Effects: Modifies the state of the formatter to be as if the path-format-spec parsed by the last call to parse contained the ? option.
constexpr typename basic_format_parse_context<charT>::iterator parse(basic_format_parse_context<charT>& ctx);
Effects: Parses the format specifier as a path-format-spec and stores the parsed specifiers in *this.
Returns: An iterator past the end of the path-format-spec.
template<class FormatContext> typename FormatContext::iterator format(const filesystem::path& p, FormatContext& ctx) const;
Effects: Let s be p.generic_string<filesystem​::​path​::​value_type>() if the g option is used, otherwise p.native().
Writes s into ctx.out(), adjusted according to the path-format-spec.
If charT is char, path​::​value_type is wchar_t, and the literal encoding is UTF-8, then the escaped path is transcoded from the native encoding for wide character strings to UTF-8 with maximal subparts of ill-formed subsequences substituted with U+fffd replacement character per the Unicode Standard, Chapter 3.9 U+fffd Substitution in Conversion.
If charT and path​::​value_type are the same then no transcoding is performed.
Otherwise, transcoding is implementation-defined.
Returns: An iterator past the end of the output range.