MySQL 8.0.40
Source Code Documentation
mysql_harness::Directory::DirectoryIterator Class Reference

Directory iterator for iterating over directory entries. More...

#include <filesystem.h>

Classes

class  State
 

Public Types

using value_type = Path
 
using iterator_category = std::input_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using pointer = value_type *
 
using reference = value_type &
 

Public Member Functions

 DirectoryIterator (const Path &path, const std::string &pattern=std::string())
 
 DirectoryIterator ()
 
 ~DirectoryIterator ()
 Destructor. More...
 
 DirectoryIterator (DirectoryIterator &&)
 
 DirectoryIterator (const DirectoryIterator &)
 
Path operator* () const
 Standard iterator operators. More...
 
DirectoryIteratoroperator++ ()
 
Path operator-> ()
 
bool operator!= (const DirectoryIterator &other) const
 
bool operator== (const DirectoryIterator &other) const
 

Private Attributes

const Path path_
 Path to the root of the directory. More...
 
std::string pattern_
 Pattern that matches entries iterated over. More...
 
std::shared_ptr< Statestate_
 

Friends

class Directory
 

Detailed Description

Directory iterator for iterating over directory entries.

A directory iterator is an input iterator.

Member Typedef Documentation

◆ difference_type

◆ iterator_category

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ DirectoryIterator() [1/4]

mysql_harness::Directory::DirectoryIterator::DirectoryIterator ( const Path path,
const std::string &  pattern = std::string() 
)

◆ DirectoryIterator() [2/4]

mysql_harness::Directory::DirectoryIterator::DirectoryIterator ( )

◆ ~DirectoryIterator()

mysql_harness::Directory::DirectoryIterator::~DirectoryIterator ( )
default

Destructor.

Note
We need this declared because the default constructor try to generate a default constructor for shared_ptr on State below, which does not work since it is not visible. The destructor need to be defined in the corresponding .cc file since the State type is visible there (but you can use a default definition).

◆ DirectoryIterator() [3/4]

mysql_harness::Directory::DirectoryIterator::DirectoryIterator ( DirectoryIterator &&  )
default

◆ DirectoryIterator() [4/4]

mysql_harness::Directory::DirectoryIterator::DirectoryIterator ( const DirectoryIterator )
default

Member Function Documentation

◆ operator!=()

◆ operator*()

Path mysql_harness::Directory::DirectoryIterator::operator* ( ) const

Standard iterator operators.

◆ operator++()

Directory::DirectoryIterator & mysql_harness::Directory::DirectoryIterator::operator++ ( )

◆ operator->()

Path mysql_harness::Directory::DirectoryIterator::operator-> ( )
inline

◆ operator==()

bool mysql_harness::Directory::DirectoryIterator::operator== ( const DirectoryIterator other) const
inline

Friends And Related Function Documentation

◆ Directory

friend class Directory
friend

Member Data Documentation

◆ path_

const Path mysql_harness::Directory::DirectoryIterator::path_
private

Path to the root of the directory.

◆ pattern_

std::string mysql_harness::Directory::DirectoryIterator::pattern_
private

Pattern that matches entries iterated over.

◆ state_

std::shared_ptr<State> mysql_harness::Directory::DirectoryIterator::state_
private

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