std::filesystem::path(3)

πŸ“¦ version 11.5.0, in centos-stream 9

πŸ’– NAME πŸ’–

This is the std::filesystem::path(3) page from the Library Functions Manual, bestie, and the name is literally the whole assignment: std::filesystem::path is a filesystem path. That's it. That's the vibe. πŸ’…βœ¨


🌸 SYNOPSIS 🌸

Okay so the synopsis is stacked β€” classes, types, a whole wall of member functions, a static attribute, friends, and related free functions. Here's the exact roster, no cap. 🫢

πŸŽ€ Classes

class iterator

An iterator for the components of a path β€” your little component tour guide. 🧚

πŸ¦‹ Public Types

using const_iterator = iterator
enum format : unsigned char { native_format, generic_format, auto_format }
using string_type = std::basic_string< value_type >
using value_type = char

Tiny but important tea: path::format is ignored in this implementation. The enum has native_format, generic_format, and auto_format, but path::format is ignored in this implementation β€” yes, literally ignored. πŸ™ˆπŸ’…

πŸ’… Public Member Functions

This is the full member-function roster. Every signature below is exact, so don't let the template wall scare you, bestie. πŸ’€βœ¨

template<typename _InputIterator , typename _Require  =
    __detail::_Path2<_InputIterator>, typename _Req2  =
    __detail::__value_type_is_char<_InputIterator>> path (_InputIterator
    __first, _InputIterator __last, const locale &__loc,
    format=auto_format)
template<typename _InputIterator , typename _Require  =
    __detail::_Path2<_InputIterator>> path (_InputIterator __first,
    _InputIterator __last, format=auto_format)
template<typename _Source , typename _Require  =
    __detail::_Path<_Source>> path (_Source const &__source,
    format=auto_format)
template<typename _Source , typename _Require  =
    __detail::_Path<_Source>, typename _Require2  =
    __detail::__value_type_is_char<_Source>> path (_Source const &__src,
    const locale &__loc, format=auto_format)
path (const path &__p)=default
path (path &&__p) noexcept
path (string_type &&__source, format=auto_format)
template<typename _InputIterator > __detail::_Path2< _InputIterator > &
    append (_InputIterator __first, _InputIterator __last)
template<typename _Source > __detail::_Path< _Source > & append (_Source
    const &__source)
template<typename _InputIterator > __detail::_Path2< _InputIterator > &
    assign (_InputIterator __first, _InputIterator __last)
template<typename _Source > __detail::_Path< _Source > & assign (_Source
    const &__source)
path & assign (string_type &&__source)
iterator begin () const
const value_type * c_str () const noexcept
void clear () noexcept
int compare (basic_string_view< value_type > __s) const noexcept
int compare (const path &__p) const noexcept
int compare (const string_type &__s) const noexcept
int compare (const value_type *__s) const noexcept
template<typename _InputIterator > __detail::_Path2< _InputIterator > &
    concat (_InputIterator __first, _InputIterator __last)
template<typename _Source > __detail::_Path< _Source > & concat (_Source
    const &__x)
bool empty () const noexcept
iterator end () const
path extension () const
path filename () const
std::string generic_string () const
template<typename _CharT , typename _Traits  = std::char_traits<_CharT>,
    typename _Allocator  = std::allocator<_CharT>> std::basic_string<
    _CharT, _Traits, _Allocator > generic_string (const _Allocator
    &__a=_Allocator()) const
std::u16string generic_u16string () const
std::u32string generic_u32string () const
std::string generic_u8string () const
std::wstring generic_wstring () const
bool has_extension () const noexcept
bool has_filename () const noexcept
bool has_parent_path () const noexcept
bool has_relative_path () const noexcept
bool has_root_directory () const noexcept
bool has_root_name () const noexcept
bool has_root_path () const noexcept
bool has_stem () const noexcept
bool is_absolute () const noexcept
bool is_relative () const noexcept
path lexically_normal () const
path lexically_proximate (const path &base) const
path lexically_relative (const path &base) const
path & make_preferred ()
const string_type & native () const noexcept
operator string_type () const
template<typename _CharT > __detail::_Path2< _CharT * > & operator+=
    (_CharT __x)
template<typename _Source > __detail::_Path< _Source > & operator+=
    (_Source const &__x)
path & operator+= (basic_string_view< value_type > __x)
path & operator+= (const path &__x)
path & operator+= (const string_type &__x)
path & operator+= (const value_type *__x)
path & operator+= (value_type __x)
template<typename _Source > __detail::_Path< _Source > & operator/=
    (_Source const &__source)
path & operator/= (const path &__p)
template<typename _Source > __detail::_Path< _Source > & operator=
    (_Source const &__source)
path & operator= (const path &)
path & operator= (path &&) noexcept
path & operator= (string_type &&__source)
path parent_path () const
path relative_path () const
path & remove_filename ()
path & replace_extension (const path &__replacement=path())
path & replace_filename (const path &__replacement)
path root_directory () const
path root_name () const
path root_path () const
path stem () const
std::string string () const
template<typename _CharT , typename _Traits , typename _Allocator >
    basic_string< _CharT, _Traits, _Allocator > string (const _Allocator
    &__a) const
template<typename _CharT , typename _Traits  = std::char_traits<_CharT>,
    typename _Allocator  = std::allocator<_CharT>> std::basic_string<
    _CharT, _Traits, _Allocator > string (const _Allocator
    &__a=_Allocator()) const
void swap (path &__rhs) noexcept
std::u16string u16string () const
std::u32string u32string () const
std::string u8string () const
std::wstring wstring () const

That's the whole member function roster: constructors, append, assign, begin, c_str, clear, compare, concat, empty, end, extension, filename, generic_string, generic_u16string, generic_u32string, generic_u8string, generic_wstring, has_extension, has_filename, has_parent_path, has_relative_path, has_root_directory, has_root_name, has_root_path, has_stem, is_absolute, is_relative, lexically_normal, lexically_proximate, lexically_relative, make_preferred, native, operator string_type, operator+=, operator/=, operator=, parent_path, relative_path, remove_filename, replace_extension, replace_filename, root_directory, root_name, root_path, stem, string, swap, u16string, u32string, u8string, and wstring. Slay. πŸ’…

🌈 Static Public Attributes

static constexpr value_type preferred_separator

The static constant in the house is preferred_separator. πŸŽ€

πŸ’œ Friends

bool operator!= (const path &__lhs, const path &__rhs) noexcept

Compare paths. The != one, obviously. πŸ’…

path operator/ (const path &__lhs, const path &__rhs)

Append one path to another. Iconic slash-append behavior. πŸ”₯

bool operator< (const path &__lhs, const path &__rhs) noexcept

Compare paths.

template<typename _CharT , typename _Traits > std::basic_ostream<
    _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits
    > &__os, const path &__p)

Write a path to a stream.

bool operator<= (const path &__lhs, const path &__rhs) noexcept

Compare paths.

bool operator== (const path &__lhs, const path &__rhs) noexcept

Compare paths.

bool operator> (const path &__lhs, const path &__rhs) noexcept

Compare paths.

bool operator>= (const path &__lhs, const path &__rhs) noexcept

Compare paths.

template<typename _CharT , typename _Traits > std::basic_istream<
    _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits
    > &__is, path &__p)

Read a path from a stream.

Note that these are not member functions β€” they're related free functions. 🫢

void swap (path &__lhs, path &__rhs) noexcept
template<typename _InputIterator , typename _Require  =
    __detail::_Path2<_InputIterator>, typename _CharT  =
    __detail::__value_type_is_char_or_char8_t<_InputIterator>> path
    u8path (_InputIterator __first, _InputIterator __last)
template<typename _Source , typename _Require  =
    __detail::_Path<_Source>, typename _CharT  =
    __detail::__value_type_is_char_or_char8_t<_Source>> path u8path
    (const _Source &__source)

✨ Detailed Description ✨

Okay so the detailed description is literally: A filesystem path. That's the whole thing. std::filesystem::path is a filesystem path. Minimal, iconic, no notes. πŸŽ€


πŸ” Member Enumeration Documentation πŸ”

🧚 enum std::filesystem::path::format : unsigned char

This enum exists, and the tea is: path::format is ignored in this implementation. So native_format, generic_format, and auto_format are in the enum, but path::format is ignored in this implementation. No cap. πŸ™ˆπŸ’…


  • bool operator!= (const path &__lhs, const path &__rhs) noexcept [friend] β€” compare paths. The != flavor, obviously. πŸ’…
  • path operator/ (const path &__lhs, const path &__rhs) [friend] β€” append one path to another. This is the slash-append one. πŸ”₯
  • bool operator< (const path &__lhs, const path &__rhs) noexcept [friend] β€” compare paths.
  • template<typename _CharT , typename _Traits > std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os, const path &__p) [friend] β€” write a path to a stream.
  • bool operator<= (const path &__lhs, const path &__rhs) noexcept [friend] β€” compare paths.
  • bool operator== (const path &__lhs, const path &__rhs) noexcept [friend] β€” compare paths.
  • bool operator> (const path &__lhs, const path &__rhs) noexcept [friend] β€” compare paths.
  • bool operator>= (const path &__lhs, const path &__rhs) noexcept [friend] β€” compare paths.
  • template<typename _CharT , typename _Traits > std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, path &__p) [friend] β€” read a path from a stream.

πŸ‘‘ Author πŸ‘‘

This page was generated automatically by Doxygen for libstdc++ from the source code. So yes, it's auto-generated, not handwritten β€” respect the pipeline, bestie. 🫢✨


Signed off by libstdc++ β€” that's the source/version β€” on Wed Oct 7 2026, bestie. That's the footer tea folded into a cute little outro. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from