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 a filesystem::path.
  • directory_entry (const filesystem::path &__p, error_code &__ec) β€” constructor that takes a filesystem::path and an error_code to 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 new filesystem::path in.
  • void assign (const filesystem::path &__p, error_code &__ec) β€” same assign, but with an error_code in the mix.
  • bool exists () const β€” the existence check, no args.
  • bool exists (error_code &__ec) const noexcept β€” existence check with an error_code, and she's noexcept so she will not be throwing hands. 😌
  • uintmax_t file_size () const β€” file size, returns uintmax_t.
  • uintmax_t file_size (error_code &__ec) const noexcept β€” file size with an error_code, noexcept.
  • uintmax_t hard_link_count () const β€” hard link count, returns uintmax_t.
  • uintmax_t hard_link_count (error_code &__ec) const noexcept β€” hard link count with an error_code, noexcept.
  • bool is_block_file () const β€” block-file check.
  • bool is_block_file (error_code &__ec) const noexcept β€” block-file check with an error_code, noexcept.
  • bool is_character_file () const β€” character-file check.
  • bool is_character_file (error_code &__ec) const noexcept β€” character-file check with an error_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 an error_code, noexcept.
  • bool is_fifo () const β€” fifo check.
  • bool is_fifo (error_code &__ec) const noexcept β€” fifo check with an error_code, noexcept.
  • bool is_other () const β€” the catch-all "other" check.
  • bool is_other (error_code &__ec) const noexcept β€” "other" check with an error_code, noexcept.
  • bool is_regular_file () const β€” regular-file check.
  • bool is_regular_file (error_code &__ec) const noexcept β€” regular-file check with an error_code, noexcept.
  • bool is_socket () const β€” socket check.
  • bool is_socket (error_code &__ec) const noexcept β€” socket check with an error_code, noexcept.
  • bool is_symlink () const β€” symlink check.
  • bool is_symlink (error_code &__ec) const noexcept β€” symlink check with an error_code, noexcept.
  • file_time_type last_write_time () const β€” last write time, returns file_time_type.
  • file_time_type last_write_time (error_code &__ec) const noexcept β€” last write time with an error_code, noexcept.
  • operator const filesystem::path & () const noexcept β€” the conversion operator, hands you back a const 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 the filesystem::path, noexcept. πŸŽ€
  • void refresh () β€” refresh, no args.
  • void refresh (error_code &__ec) noexcept β€” refresh with an error_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 an error_code.
  • file_status status () const β€” returns file_status.
  • file_status status (error_code &__ec) const noexcept β€” file_status with an error_code, noexcept.
  • file_status symlink_status () const β€” returns file_status for the symlink.
  • file_status symlink_status (error_code &__ec) const noexcept β€” symlink file_status with an error_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 << a directory_entry into a basic_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