27 Input/output library [input.output]

27.10 File systems [filesystems]

27.10.8 Class path [class.path]

27.10.8.4 path members [path.member]

27.10.8.4.7 path generic format observers [path.generic.obs]

Generic format observer functions return strings formatted according to the generic pathname format ([path.generic]). The forward slash ('/') character is used as the directory-separator character.

Example: On an operating system that uses backslash as its preferred-separator, path("foo\\bar").generic_string() returns "foo/bar".  — end example ]

template <class EcharT, class traits = char_traits<EcharT>, class Allocator = allocator<EcharT>> basic_string<EcharT, traits, Allocator> generic_string(const Allocator& a = Allocator()) const;

Returns: pathstring, reformatted according to the generic pathname format ([path.generic]).

Remarks: All memory allocation, including for the return value, shall be performed by a. Conversion, if any, is specified by [path.cvt].

std::string generic_string() const; std::wstring generic_wstring() const; std::string generic_u8string() const; std::u16string generic_u16string() const; std::u32string generic_u32string() const;

Returns: pathstring, reformatted according to the generic pathname format ([path.generic]).

Remarks: Conversion, if any, is specified by [path.cvt]. The encoding of the string returned by generic_u8string() is always UTF-8.