#
Formatting of paths uses formatting specifiers of the form
path-format-spec:
fill-and-align
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.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant