libstdc++: std::filesystem::directory_entry Class Reference

libstdc++

std::filesystem::directory_entry Class Reference
Filesystem

`#include <filesystem>`

## Public Member Functions
| directory_entry (const directory_entry &)=default
| directory_entry (const filesystem::path &__p)
| directory_entry (const filesystem::path &__p, error_code &__ec)
| directory_entry (directory_entry &&) noexcept=default
void | assign (const filesystem::path &__p)
void | assign (const filesystem::path &__p, error_code &__ec)
bool | exists () const
bool | exists (error_code &__ec) const noexcept
uintmax_t | file_size () const
uintmax_t | file_size (error_code &__ec) const noexcept
uintmax_t | hard_link_count () const
uintmax_t | hard_link_count (error_code &__ec) const noexcept
bool | is_block_file () const
bool | is_block_file (error_code &__ec) const noexcept
bool | is_character_file () const
bool | is_character_file (error_code &__ec) const noexcept
bool | is_directory () const
bool | is_directory (error_code &__ec) const noexcept
bool | is_fifo () const
bool | is_fifo (error_code &__ec) const noexcept
bool | is_other () const
bool | is_other (error_code &__ec) const noexcept
bool | is_regular_file () const
bool | is_regular_file (error_code &__ec) const noexcept
bool | is_socket () const
bool | is_socket (error_code &__ec) const noexcept
bool | is_symlink () const
bool | is_symlink (error_code &__ec) const noexcept
file_time_type | last_write_time () const
file_time_type | last_write_time (error_code &__ec) const noexcept
| operator const filesystem::path & () const noexcept
strong_ordering | operator<=> (const directory_entry &__rhs) const noexcept
directory_entry & | operator= (const directory_entry &)=default
directory_entry & | operator= (directory_entry &&) noexcept=default
bool | operator== (const directory_entry &__rhs) const noexcept
const filesystem::path & | path () const noexcept
void | refresh ()
void | refresh (error_code &__ec) noexcept
void | replace_filename (const filesystem::path &__p)
void | replace_filename (const filesystem::path &__p, error_code &__ec)
file_status | status () const
file_status | status (error_code &__ec) const noexcept
file_status | symlink_status () const
file_status | symlink_status (error_code &__ec) const noexcept

## Friends
struct | _Dir
class | directory_iterator
template<typename _CharT, typename _Traits>
basic_ostream< _CharT, _Traits > & | operator<< (basic_ostream< _CharT, _Traits > &__os, const directory_entry &__d)
class | recursive_directory_iterator

## Detailed Description

The value type used by directory iterators.

Since
  C++17

Definition at line 106 of file bits/fs_dir.h.

## Constructor & Destructor Documentation

## ◆ directory_entry() [1/2]

std::filesystem::directory_entry::directory_entry | ( | const filesystem::path & | __p | ) |
| inlineexplicit

Definition at line 115 of file bits/fs_dir.h.

## ◆ directory_entry() [2/2]

std::filesystem::directory_entry::directory_entry | ( | const filesystem::path & | __p,
|  | error_code & | __ec )
| inline

Definition at line 119 of file bits/fs_dir.h.

## Member Function Documentation

## ◆ assign() [1/2]

void std::filesystem::directory_entry::assign | ( | const filesystem::path & | __p | ) |
| inline

Definition at line 134 of file bits/fs_dir.h.

## ◆ assign() [2/2]

void std::filesystem::directory_entry::assign | ( | const filesystem::path & | __p,
|  | error_code & | __ec )
| inline

Definition at line 141 of file bits/fs_dir.h.

## ◆ exists() [1/2]

bool std::filesystem::directory_entry::exists | ( |  | ) | const
| inline

Definition at line 174 of file bits/fs_dir.h.

## ◆ exists() [2/2]

bool std::filesystem::directory_entry::exists | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 178 of file bits/fs_dir.h.

## ◆ file_size() [1/2]

uintmax_t std::filesystem::directory_entry::file_size | ( |  | ) | const
| inline

Definition at line 254 of file bits/fs_dir.h.

## ◆ file_size() [2/2]

uintmax_t std::filesystem::directory_entry::file_size | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 258 of file bits/fs_dir.h.

## ◆ hard_link_count() [1/2]

uintmax_t std::filesystem::directory_entry::hard_link_count | ( |  | ) | const
| inline

Definition at line 262 of file bits/fs_dir.h.

## ◆ hard_link_count() [2/2]

uintmax_t std::filesystem::directory_entry::hard_link_count | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 266 of file bits/fs_dir.h.

## ◆ is_block_file() [1/2]

bool std::filesystem::directory_entry::is_block_file | ( |  | ) | const
| inline

Definition at line 182 of file bits/fs_dir.h.

## ◆ is_block_file() [2/2]

bool std::filesystem::directory_entry::is_block_file | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 186 of file bits/fs_dir.h.

## ◆ is_character_file() [1/2]

bool std::filesystem::directory_entry::is_character_file | ( |  | ) | const
| inline

Definition at line 190 of file bits/fs_dir.h.

## ◆ is_character_file() [2/2]

bool std::filesystem::directory_entry::is_character_file | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 194 of file bits/fs_dir.h.

## ◆ is_directory() [1/2]

bool std::filesystem::directory_entry::is_directory | ( |  | ) | const
| inline

Definition at line 198 of file bits/fs_dir.h.

## ◆ is_directory() [2/2]

bool std::filesystem::directory_entry::is_directory | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 202 of file bits/fs_dir.h.

## ◆ is_fifo() [1/2]

bool std::filesystem::directory_entry::is_fifo | ( |  | ) | const
| inline

Definition at line 206 of file bits/fs_dir.h.

## ◆ is_fifo() [2/2]

bool std::filesystem::directory_entry::is_fifo | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 210 of file bits/fs_dir.h.

## ◆ is_other() [1/2]

bool std::filesystem::directory_entry::is_other | ( |  | ) | const
| inline

Definition at line 214 of file bits/fs_dir.h.

## ◆ is_other() [2/2]

bool std::filesystem::directory_entry::is_other | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 218 of file bits/fs_dir.h.

## ◆ is_regular_file() [1/2]

bool std::filesystem::directory_entry::is_regular_file | ( |  | ) | const
| inline

Definition at line 222 of file bits/fs_dir.h.

## ◆ is_regular_file() [2/2]

bool std::filesystem::directory_entry::is_regular_file | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 226 of file bits/fs_dir.h.

## ◆ is_socket() [1/2]

bool std::filesystem::directory_entry::is_socket | ( |  | ) | const
| inline

Definition at line 230 of file bits/fs_dir.h.

## ◆ is_socket() [2/2]

bool std::filesystem::directory_entry::is_socket | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 234 of file bits/fs_dir.h.

## ◆ is_symlink() [1/2]

bool std::filesystem::directory_entry::is_symlink | ( |  | ) | const
| inline

Definition at line 238 of file bits/fs_dir.h.

## ◆ is_symlink() [2/2]

bool std::filesystem::directory_entry::is_symlink | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 246 of file bits/fs_dir.h.

## ◆ last_write_time() [1/2]

file_time_type std::filesystem::directory_entry::last_write_time | ( |  | ) | const
| inline

Definition at line 270 of file bits/fs_dir.h.

## ◆ last_write_time() [2/2]

file_time_type std::filesystem::directory_entry::last_write_time | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 275 of file bits/fs_dir.h.

## ◆ operator const filesystem::path &()

std::filesystem::directory_entry::operator const filesystem::path & | ( |  | ) | const
| inlinenoexcept

Definition at line 171 of file bits/fs_dir.h.

## ◆ operator<=>()

strong_ordering std::filesystem::directory_entry::operator<=> | ( | const directory_entry & | __rhs | ) | const
| inlinenoexcept

Definition at line 299 of file bits/fs_dir.h.

## ◆ operator==()

bool std::filesystem::directory_entry::operator== | ( | const directory_entry & | __rhs | ) | const
| inlinenoexcept

Definition at line 295 of file bits/fs_dir.h.

## ◆ path()

const filesystem::path & std::filesystem::directory_entry::path | ( |  | ) | const
| inlinenoexcept

Definition at line 170 of file bits/fs_dir.h.

## ◆ refresh() [1/2]

void std::filesystem::directory_entry::refresh | ( |  | ) |
| inline

Definition at line 162 of file bits/fs_dir.h.

## ◆ refresh() [2/2]

void std::filesystem::directory_entry::refresh | ( | error_code & | __ec | ) |
| inlinenoexcept

Definition at line 166 of file bits/fs_dir.h.

## ◆ replace_filename() [1/2]

void std::filesystem::directory_entry::replace_filename | ( | const filesystem::path & | __p | ) |
| inline

Definition at line 148 of file bits/fs_dir.h.

## ◆ replace_filename() [2/2]

void std::filesystem::directory_entry::replace_filename | ( | const filesystem::path & | __p,
|  | error_code & | __ec )
| inline

Definition at line 155 of file bits/fs_dir.h.

## ◆ status() [1/2]

file_status std::filesystem::directory_entry::status | ( |  | ) | const
| inline

Definition at line 279 of file bits/fs_dir.h.

## ◆ status() [2/2]

file_status std::filesystem::directory_entry::status | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 283 of file bits/fs_dir.h.

## ◆ symlink_status() [1/2]

file_status std::filesystem::directory_entry::symlink_status | ( |  | ) | const
| inline

Definition at line 287 of file bits/fs_dir.h.

## ◆ symlink_status() [2/2]

file_status std::filesystem::directory_entry::symlink_status | ( | error_code & | __ec | ) | const
| inlinenoexcept

Definition at line 291 of file bits/fs_dir.h.

## Friends And Related Symbol Documentation

## ◆ _Dir

friend struct _Dir
| friend

Definition at line 325 of file bits/fs_dir.h.

## ◆ directory_iterator

friend class directory_iterator
| friend

Definition at line 326 of file bits/fs_dir.h.

## ◆ operator<<

template<typename _CharT, typename _Traits>

basic_ostream< _CharT, _Traits > & operator<< | ( | basic_ostream< _CharT, _Traits > & | __os,
|  | const directory_entry & | __d )
| friend

Definition at line 332 of file bits/fs_dir.h.

## ◆ recursive_directory_iterator

friend class recursive_directory_iterator
| friend

Definition at line 327 of file bits/fs_dir.h.

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

- bits/fs_dir.h