std::filesyste...ectory_iterator(3cxx)

🌸 NAME

std::filesystem::directory_iterator β€” bestie, it's the iterator type for traversing the entries in a single directory. That's it, that's the whole vibe. One directory. You go through it, entry by entry. Iconic. πŸ’…


✨ SYNOPSIS

#include <fs_dir.h>

πŸŽ€ Public Types

  • typedef ptrdiff_t difference_type β€” the difference type, for when you gotta measure the gap between two of these bad boys.
  • typedef input_iterator_tag iterator_category β€” it's an input iterator, so it's giving one-pass, read-only, don't-get-greedy energy. No random access here, sorry bestie.
  • typedef const directory_entry * pointer β€” pointer to a const directory_entry.
  • typedef const directory_entry & reference β€” reference to a const directory_entry.
  • typedef directory_entry value_type β€” the value type is directory_entry. Obviously.

πŸ¦‹ Public Member Functions

  • directory_iterator (const directory_iterator &__rhs)=default β€” copy constructor, defaulted. Copy away, queen.
  • directory_iterator (const path &__p) β€” construct from a path. Just the path.
  • directory_iterator (const path &__p, directory_options __options) β€” construct from a path and directory_options. Fancy.
  • directory_iterator (const path &__p, directory_options __options, error_code &__ec) β€” path, options, and an error_code you can check instead of getting jumped by an exception.
  • directory_iterator (const path &__p, error_code &__ec) β€” path plus an error_code. Same deal, no options.
  • directory_iterator (directory_iterator &&__rhs) noexcept=default β€” move constructor, defaulted, noexcept. She moves. Effortlessly. ✨
  • directory_iterator & increment (error_code &__ec) β€” advance it, and report any problem through __ec.
  • const directory_entry & operator* () const noexcept β€” dereference, get the directory_entry. noexcept, so no surprises.
  • directory_iterator & operator++ () β€” pre-increment. Step to the next entry.
  • __directory_iterator_proxy operator++ (int) β€” post-increment, and it returns a __directory_iterator_proxy. (iykyk)
  • const directory_entry * operator-> () const noexcept β€” arrow operator, reach into the entry. Also noexcept.
  • directory_iterator & operator= (const directory_iterator &__rhs)=default β€” copy assignment, defaulted.
  • directory_iterator & operator= (directory_iterator &&__rhs) noexcept=default β€” move assignment, defaulted, noexcept. Periodt.

πŸ’œ Friends

  • bool operator!= (const directory_iterator &__lhs, const directory_iterator &__rhs) noexcept β€” not-equal comparison. This is literally how you know you've hit the end, bestie.
  • bool operator== (const directory_iterator &__lhs, const directory_iterator &__rhs) noexcept β€” equals comparison. Two iterators, same energy?
  • class recursive_directory_iterator β€” a whole friend class! It gets access. It's in the group chat.
Heads up: these are not member symbols. They're just here, hanging out, being useful.
  • directory_iterator begin (directory_iterator __iter) noexcept β€” Enable range-based for using directory_iterator. So you can write the cute for (auto& e : dir) thing. Slay.
  • directory_iterator end (directory_iterator) noexcept β€” Return a past-the-end directory_iterator. The finish line. 🏁

πŸ’– Detailed Description

Iterator type for traversing the entries in a single directory.


πŸ‘‘ Author

Generated automatically by Doxygen for libstdc++ from the source code. (The man page itself is from the 3cxx manual section, and it's carrying the libstdc++ source and version tag on its little footer.) So technically nobody wrote this by hand β€” the machine did it, and honestly? She ate. 🫢✨ Thanks for reading, bestie, now go iterate responsibly. πŸŽ€

πŸ“¦ where this page comes from