Files
2025-10-25 03:02:53 +03:00

3.2 KiB

[fs.path.generic.obs]

31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.6 Class path [fs.class.path]

31.12.6.5 Members [fs.path.member]

31.12.6.5.7 Generic format observers [fs.path.generic.obs]

1

#

Generic format observer functions return strings formatted according to thegeneric pathname format.

A single slash ('/') character is used as the directory-separator.

2

#

[Example 1:

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;

3

#

Returns: The pathname in the generic format.

4

#

Remarks: All memory allocation, including for the return value, shall be performed by a.

Conversion, if any, is specified by[fs.path.cvt].

🔗

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

5

#

Returns: The pathname in the generic format.

6

#

Remarks: Conversion, if any, is specified by [fs.path.cvt].

🔗

std::string generic_display_string() const;

7

#

Returns: format("{:g}", *this).

[Note 1:

The returned string is suitable for use with formatting ([format.functions]) and print functions ([print.fun]).

— end note]