Namespaces
Variants
Actions

std::formatter<std::filesystem::path>

From cppreference.com
< cpp‎ | filesystem‎ | path
 
 
 
 
Defined in header <filesystem>
template< class CharT >
struct formatter<std::filesystem::path, CharT>;
(since C++26)

The template specialization of std::formatter for the std::filesystem::path class allows users to convert a pathname to its textual representation using formatting functions. This specialization is debug-enabled.

Contents

[edit] Format specification

The syntax of format specifications path-format-spec is:

fill-and-align (optional) width (optional) ?(optional) g(optional)

fill-and-align and width have the same meaning as in standard format specification.

The ? option is used to format the pathname as an escaped string.

The g option is used to specify that the pathname is in generic-format representation.

[edit] Member functions

set_debug_format
enables to format the pathname as an escaped string
(public member function)
parse
parses the format specifier as specified by path-format-spec
(public member function)
format
writes the formatted output as specified by path-format-spec
(public member function)

std::formatter<std::filesystem::path>::set_debug_format

constexpr void set_debug_format();

Allows the current object to format pathname as an escaped string.

std::formatter<std::filesystem::path>::parse

constexpr auto parse( std::basic_format_parse_context<CharT>& ctx )
    ->