libstdc++
std::filesystem::path Class Reference

#include <fs_path.h>

Classes

class  iterator
 

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
 

Public Member Functions

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)
 
pathassign (string_type &&__source)
 
iterator begin () const noexcept
 
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 noexcept
 
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
 
pathmake_preferred ()
 
const string_typenative () 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)
 
pathoperator+= (basic_string_view< value_type > __x)
 
pathoperator+= (const path &__x)
 
pathoperator+= (const string_type &__x)
 
pathoperator+= (const value_type *__x)
 
pathoperator+= (value_type __x)
 
template<typename _Source >
__detail::_Path< _Source > & operator/= (_Source const &__source)
 
pathoperator/= (const path &__p)
 
template<typename _Source >
__detail::_Path< _Source > & operator= (_Source const &__source)
 
pathoperator= (const path &)
 
pathoperator= (path &&) noexcept
 
pathoperator= (string_type &&__source)
 
path parent_path () const
 
path relative_path () const
 
pathremove_filename ()
 
pathreplace_extension (const path &__replacement=path())
 
pathreplace_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
 

Static Public Attributes

static constexpr value_type preferred_separator
 

Friends

bool operator!= (const path &__lhs, const path &__rhs) noexcept
 
path operator/ (const path &__lhs, const path &__rhs)
 
bool operator< (const path &__lhs, const path &__rhs) noexcept
 
template<typename _CharT , typename _Traits >
std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os, const path &__p)
 
bool operator<= (const path &__lhs, const path &__rhs) noexcept
 
bool operator== (const path &__lhs, const path &__rhs) noexcept
 
bool operator> (const path &__lhs, const path &__rhs) noexcept
 
bool operator>= (const path &__lhs, const path &__rhs) noexcept
 
template<typename _CharT , typename _Traits >
std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, path &__p)
 

Related Symbols

(Note that these are not member symbols.)

void swap (same_as< path > auto &__lhs, same_as< path > auto &__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

A filesystem path.

Definition at line 292 of file bits/fs_path.h.

Member Typedef Documentation

◆ const_iterator

◆ string_type

Definition at line 307 of file bits/fs_path.h.

◆ value_type

using std::filesystem::path::value_type = char

Definition at line 303 of file bits/fs_path.h.

Member Enumeration Documentation

◆ format

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

path::format is ignored in this implementation

Definition at line 310 of file bits/fs_path.h.

Constructor & Destructor Documentation

◆ path() [1/7]

std::filesystem::path::path ( )
inlinenoexcept

Definition at line 314 of file bits/fs_path.h.

◆ path() [2/7]

std::filesystem::path::path ( path &&  __p)
inlinenoexcept

Definition at line 318 of file bits/fs_path.h.

◆ path() [3/7]

std::filesystem::path::path ( string_type &&  __source,
format  = auto_format 
)
inline

Definition at line 323 of file bits/fs_path.h.

◆ path() [4/7]

template<typename _Source , typename _Require = __detail::_Path<_Source>>
std::filesystem::path::path ( _Source const &  __source,
format  = auto_format 
)
inline

Definition at line 329 of file bits/fs_path.h.

◆ path() [5/7]

template<typename _InputIterator , typename _Require = __detail::_Path2<_InputIterator>>
std::filesystem::path::path ( _InputIterator  __first,
_InputIterator  __last,
format  = auto_format 
)
inline

Definition at line 335 of file bits/fs_path.h.

◆ path() [6/7]

template<typename _Source , typename _Require = __detail::_Path<_Source>, typename _Require2 = __detail::__value_type_is_char<_Source>>
std::filesystem::path::path ( _Source const &  __src,
const locale __loc,
format  = auto_format 
)
inline

Definition at line 342 of file bits/fs_path.h.

◆ path() [7/7]

template<typename _InputIterator , typename _Require = __detail::_Path2<_InputIterator>, typename _Req2 = __detail::__value_type_is_char<_InputIterator>>
std::filesystem::path::path ( _InputIterator  __first,
_InputIterator  __last,
const locale __loc,
format  = auto_format 
)
inline

Definition at line 349 of file bits/fs_path.h.

Member Function Documentation

◆ append() [1/2]

template<typename _InputIterator >
__detail::_Path2< _InputIterator > & std::filesystem::path::append ( _InputIterator  __first,
_InputIterator  __last 
)
inline

Definition at line 400 of file bits/fs_path.h.

◆ append() [2/2]

template<typename _Source >
__detail::_Path< _Source > & std::filesystem::path::append ( _Source const &  __source)
inline

Definition at line 392 of file bits/fs_path.h.

◆ assign() [1/2]

template<typename _InputIterator >
__detail::_Path2< _InputIterator > & std::filesystem::path::assign ( _InputIterator  __first,
_InputIterator  __last 
)
inline

Definition at line 375 of file bits/fs_path.h.

◆ assign() [2/2]

template<typename _Source >
__detail::_Path< _Source > & std::filesystem::path::assign ( _Source const &  __source)
inline

Definition at line 370 of file bits/fs_path.h.

◆ c_str()

const value_type * std::filesystem::path::c_str ( ) const
inlinenoexcept

Definition at line 452 of file bits/fs_path.h.

◆ clear()

void std::filesystem::path::clear ( )
inlinenoexcept

Definition at line 440 of file bits/fs_path.h.

◆ concat() [1/2]

template<typename _InputIterator >
__detail::_Path2< _InputIterator > & std::filesystem::path::concat ( _InputIterator  __first,
_InputIterator  __last 
)
inline

Definition at line 432 of file bits/fs_path.h.

◆ concat() [2/2]

template<typename _Source >
__detail::_Path< _Source > & std::filesystem::path::concat ( _Source const &  __x)
inline

Definition at line 424 of file bits/fs_path.h.

◆ empty()

bool std::filesystem::path::empty ( ) const
inlinenoexcept

Definition at line 512 of file bits/fs_path.h.

◆ is_relative()

bool std::filesystem::path::is_relative ( ) const
inlinenoexcept

Definition at line 522 of file bits/fs_path.h.

◆ native()

const string_type & std::filesystem::path::native ( ) const
inlinenoexcept

Definition at line 451 of file bits/fs_path.h.

◆ operator string_type()

std::filesystem::path::operator string_type ( ) const
inline

Definition at line 453 of file bits/fs_path.h.

◆ operator+=()

template<typename _Source >
__detail::_Path< _Source > & std::filesystem::path::operator+= ( _Source const &  __x)
inline

Definition at line 416 of file bits/fs_path.h.

◆ operator/=()

template<typename _Source >
__detail::_Path< _Source > & std::filesystem::path::operator/= ( _Source const &  __source)
inline

Definition at line 384 of file bits/fs_path.h.

◆ operator=()

template<typename _Source >
__detail::_Path< _Source > & std::filesystem::path::operator= ( _Source const &  __source)
inline

Definition at line 365 of file bits/fs_path.h.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const path __lhs,
const path __rhs 
)
friend

Compare paths.

Definition at line 569 of file bits/fs_path.h.

◆ operator/

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

Append one path to another.

Definition at line 590 of file bits/fs_path.h.

◆ operator<

bool operator< ( const path __lhs,
const path __rhs 
)
friend

Compare paths.

Definition at line 573 of file bits/fs_path.h.

◆ operator<<

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.

Definition at line 538 of file bits/fs_path.h.

◆ operator<=

bool operator<= ( const path __lhs,
const path __rhs 
)
friend

Compare paths.

Definition at line 577 of file bits/fs_path.h.

◆ operator==

bool operator== ( const path __lhs,
const path __rhs 
)
friend

Compare paths.

Definition at line 559 of file bits/fs_path.h.

◆ operator>

bool operator> ( const path __lhs,
const path __rhs 
)
friend

Compare paths.

Definition at line 581 of file bits/fs_path.h.

◆ operator>=

bool operator>= ( const path __lhs,
const path __rhs 
)
friend

Compare paths.

Definition at line 585 of file bits/fs_path.h.

◆ operator>>

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.

Definition at line 548 of file bits/fs_path.h.

Member Data Documentation

◆ preferred_separator

constexpr value_type std::filesystem::path::preferred_separator
staticconstexpr

Definition at line 305 of file bits/fs_path.h.


The documentation for this class was generated from the following file: