std::filesystem::directory_iterator Class Reference
File System

`#include <filesystem>`

## Public Types

typedef ptrdiff_t | difference_type
typedef input_iterator_tag | iterator_category
typedef const directory_entry * | pointer
typedef const directory_entry & | reference
typedef directory_entry | value_type

## Public Member Functions

| directory_iterator (const directory_iterator &__rhs)=default
| directory_iterator (const path &__p)
| directory_iterator (const path &__p, directory_options __options)
| directory_iterator (const path &__p, directory_options __options, error_code &__ec)
| directory_iterator (const path &__p, error_code &__ec)
| directory_iterator (directory_iterator &&__rhs) noexcept=default
directory_iterator & | increment (error_code &__ec)
const directory_entry & | operator* () const noexcept
directory_iterator & | operator++ ()
__directory_iterator_proxy | operator++ (int)
const directory_entry * | operator-> () const noexcept
directory_iterator & | operator= (const directory_iterator &__rhs)=default
directory_iterator & | operator= (directory_iterator &&__rhs) noexcept=default
bool | operator== (default_sentinel_t) const noexcept

## Friends

bool | operator== (const directory_iterator &__lhs, const directory_iterator &__rhs) noexcept
class | recursive_directory_iterator

## Related Symbols

(Note that these are not member symbols.)
directory_iterator | begin (directory_iterator __iter) noexcept
directory_iterator | end (directory_iterator) noexcept
recursive_directory_iterator | begin (recursive_directory_iterator __iter) noexcept
recursive_directory_iterator | end (recursive_directory_iterator) noexcept

## Detailed Description

Iterator type for traversing the entries in a single directory.

Since
  C++17

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

## Member Typedef Documentation

## difference_type

typedef ptrdiff_t std::filesystem::directory_iterator::difference_type

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

## iterator_category

typedef input_iterator_tag std::filesystem::directory_iterator::iterator_category

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

## pointer

typedef const directory_entry* std::filesystem::directory_iterator::pointer

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

## reference

typedef const directory_entry& std::filesystem::directory_iterator::reference

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

## value_type

typedef directory_entry std::filesystem::directory_iterator::value_type

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

## Constructor & Destructor Documentation

## directory_iterator() [1/4]

std::filesystem::directory_iterator::directory_iterator | ( | const path & | __p | ) |

inline explicit

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

## directory_iterator() [2/4]

std::filesystem::directory_iterator::directory_iterator | ( | const path & | __p,
|  | directory_options | __options )

inline

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

## directory_iterator() [3/4]

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

inline

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

## directory_iterator() [4/4]

std::filesystem::directory_iterator::directory_iterator | ( | const path & | __p,
|  | directory_options | __options,
|  | error_code & | __ec )

inline

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

## Member Function Documentation

## operator++()

__directory_iterator_proxy std::filesystem::directory_iterator::operator++ | ( | int |  | ) |

inline

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

## operator->()

const directory_entry * std::filesystem::directory_iterator::operator-> | ( |  | ) | const

inline noexcept

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

## operator==()

bool std::filesystem::directory_iterator::operator== | ( | default_sentinel_t |  | ) | const

inline noexcept

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

## Friends And Related Symbol Documentation

## operator==

bool operator== | ( | const directory_iterator & | __lhs,
|  | const directory_iterator & | __rhs )

friend

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

## recursive_directory_iterator

friend class recursive_directory_iterator

friend

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

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

- bits/fs_dir.h