std::filesystem::directory_entry(3cxx)
β¨ std::filesystem::directory_entry β¨
okay bestie, welcome to section 3cxx of the libstdc++ manual π this is the page for std::filesystem::directory_entry, and yes it's a whole glow-up. buckle up, it's giving C++ filesystem core and we're obsessed. π¦
πΈ NAME πΈ
std::filesystem::directory_entry β the value type used by directory iterators. that's it, that's her whole job title. π
π SYNOPSIS π
#include <fs_dir.h>
π Public Member Functions π
directory_entry (const directory_entry &)=defaultβ the copy constructor, and she's=defaulted, so the compiler is handling it, no notes. πdirectory_entry (const filesystem::path &__p)β constructor that takes afilesystem::path.directory_entry (const filesystem::path &__p, error_code &__ec)β constructor that takes afilesystem::pathand anerror_codeto write into.directory_entry (directory_entry &&) noexcept=defaultβ the move constructor,noexcept,=defaulted, iconic behaviour, no cap. π«Άvoid assign (const filesystem::path &__p)β assign a newfilesystem::pathin.void assign (const filesystem::path &__p, error_code &__ec)β same assign, but with anerror_codein the mix.bool exists () constβ the existence check, no args.bool exists (error_code &__ec) const noexceptβ existence check with anerror_code, and she'snoexceptso she will not be throwing hands. πuintmax_t file_size () constβ file size, returnsuintmax_t.uintmax_t file_size (error_code &__ec) const noexceptβ file size with anerror_code,noexcept.uintmax_t hard_link_count () constβ hard link count, returnsuintmax_t.uintmax_t hard_link_count (error_code &__ec) const noexceptβ hard link count with anerror_code,noexcept.bool is_block_file () constβ block-file check.bool is_block_file (error_code &__ec) const noexceptβ block-file check with anerror_code,noexcept.bool is_character_file () constβ character-file check.bool is_character_file (error_code &__ec) const noexceptβ character-file check with anerror_code,noexcept.bool is_directory () constβ the is-this-a-directory check.bool is_directory (error_code &__ec) const noexceptβ is-this-a-directory, with anerror_code,noexcept.bool is_fifo () constβ fifo check.bool is_fifo (error_code &__ec) const noexceptβ fifo check with anerror_code,noexcept.bool is_other () constβ the catch-all "other" check.bool is_other (error_code &__ec) const noexceptβ "other" check with anerror_code,noexcept.bool is_regular_file () constβ regular-file check.bool is_regular_file (error_code &__ec) const noexceptβ regular-file check with anerror_code,noexcept.bool is_socket () constβ socket check.bool is_socket (error_code &__ec) const noexceptβ socket check with anerror_code,noexcept.bool is_symlink () constβ symlink check.bool is_symlink (error_code &__ec) const noexceptβ symlink check with anerror_code,noexcept.file_time_type last_write_time () constβ last write time, returnsfile_time_type.file_time_type last_write_time (error_code &__ec) const noexceptβ last write time with anerror_code,noexcept.operator const filesystem::path & () const noexceptβ the conversion operator, hands you back aconst filesystem::path &,noexcept. she's a giver.bool operator!= (const directory_entry &__rhs) const noexceptβ not-equal,noexcept.bool operator< (const directory_entry &__rhs) const noexceptβ less-than,noexcept.bool operator<= (const directory_entry &__rhs) const noexceptβ less-than-or-equal,noexcept.directory_entry & operator= (const directory_entry &)=defaultβ copy assignment,=defaulted.directory_entry & operator= (directory_entry &&) noexcept=defaultβ move assignment,noexcept,=defaulted.bool operator== (const directory_entry &__rhs) const noexceptβ equal-equal,noexcept.bool operator> (const directory_entry &__rhs) const noexceptβ greater-than,noexcept.bool operator>= (const directory_entry &__rhs) const noexceptβ greater-than-or-equal,noexcept.const filesystem::path & path () const noexceptβ gives you thefilesystem::path,noexcept. πvoid refresh ()β refresh, no args.void refresh (error_code &__ec) noexceptβ refresh with anerror_code,noexcept.void replace_filename (const filesystem::path &__p)β swap the filename out for__p.void replace_filename (const filesystem::path &__p, error_code &__ec)β same swap, with anerror_code.file_status status () constβ returnsfile_status.file_status status (error_code &__ec) const noexceptβfile_statuswith anerror_code,noexcept.file_status symlink_status () constβ returnsfile_statusfor the symlink.file_status symlink_status (error_code &__ec) const noexceptβ symlinkfile_statuswith anerror_code,noexcept.
not me listing every single overload π but bestie, they all matter and we do not skip.
π«Ά Friends π«Ά
struct _Dirβ friend struct, she's in the inner circle.class directory_iteratorβ friend class, obviously.template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & operator<< (basic_ostream< _CharT, _Traits > &__os, const directory_entry &__d)β the stream insertion friend, so you can<<adirectory_entryinto abasic_ostream< _CharT, _Traits >.class recursive_directory_iteratorβ also a friend. the whole squad is here fr fr. π
π Detailed Description π
The value type used by directory iterators. lowkey the shortest detailed description ever and honestly? she said everything she needed to say. β¨
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
and that's the whole page, bestie π this was std::filesystem::directory_entry, section 3cxx, straight out of libstdc++'s docs β auto-generated by Doxygen from the source code, so no human author to credit, just the machine doing her thing. no date to report because she's built fresh by the toolchain. periodt. ππΈπ¦π
π¦ where this page comes from
- ubuntu noble: libstdc++-11-doc 11.4.0-9ubuntu1
- ubuntu noble: libstdc++-11-doc 11.5.0-1ubuntu1~24.04.1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms