zz::fs::Directory Class Reference

The Directory class for filesystem directory operations. More...

#include <zupply.hpp>

Public Types

using iterator = std::vector< Path >::iterator
 
using const_iterator = std::vector< Path >::const_iterator
 

Public Member Functions

 Directory (std::string root, bool recursive=false)
 Directory constructor. More...
 
 Directory (std::string root, const std::string pattern, bool recursive=false)
 Directory constructor with filter pattern. More...
 
 Directory (std::string root, const std::vector< std::string > patternList, bool recursive)
 Directory constructor with filter pattern. More...
 
 Directory (std::string root, const std::vector< const char * > patternList, bool recursive)
 Directory constructor with filter pattern. More...
 
iterator begin ()
 Return begin iterator. More...
 
iterator end ()
 Return end iterator. More...
 
const_iterator cbegin () const
 Return const begin iterator. More...
 
const_iterator cend () const
 Return const end iterator. More...
 
std::size_t size () const
 Return number of contained directories or files. More...
 
bool is_recursive () const
 Check if directory is resursively searched. More...
 
std::string root () const
 Return root of directory. More...
 
void filter (const std::string pattern)
 Filter directory with specified pattern. More...
 
void filter (const std::vector< const char * > patternList)
 Filter directory with multiple patterns. More...
 
void filter (const std::vector< std::string > patternList)
 Filter directory with multiple patterns. More...
 
void reset ()
 Clear filter pattern, redo search in directory.
 
std::vector< Pathto_list () const
 Return the entire list. More...
 

Detailed Description

The Directory class for filesystem directory operations.

Constructor & Destructor Documentation

zz::fs::Directory::Directory ( std::string  root,
bool  recursive = false 
)

Directory constructor.

Parameters
rootRoot of directory
recursiveRecursive search or not
zz::fs::Directory::Directory ( std::string  root,
const std::string  pattern,
bool  recursive = false 
)

Directory constructor with filter pattern.

Parameters
rootRoot of directory
patternFilter pattern
recursiveRecursive search or not
zz::fs::Directory::Directory ( std::string  root,
const std::vector< std::string >  patternList,
bool  recursive 
)

Directory constructor with filter pattern.

Parameters
rootRoot of directory
patternListVector of filter patterns
recursiveRecursive search or not
zz::fs::Directory::Directory ( std::string  root,
const std::vector< const char * >  patternList,
bool  recursive 
)

Directory constructor with filter pattern.

Parameters
rootRoot of directory
patternListVector of filter patterns
recursiveRecursive search or not

Member Function Documentation

iterator zz::fs::Directory::begin ( )
inline

Return begin iterator.

Returns
Iterator to begin
const_iterator zz::fs::Directory::cbegin ( ) const
inline

Return const begin iterator.

Returns
Iterator to cbegin
const_iterator zz::fs::Directory::cend ( ) const
inline

Return const end iterator.

Returns
Iterator to cend
iterator zz::fs::Directory::end ( )
inline

Return end iterator.

Returns
Iterator to end
void zz::fs::Directory::filter ( const std::string  pattern)

Filter directory with specified pattern.

Parameters
Wildcard matching pattern
void zz::fs::Directory::filter ( const std::vector< const char * >  patternList)

Filter directory with multiple patterns.

Parameters
patternListVector of wild card matching patterns
void zz::fs::Directory::filter ( const std::vector< std::string >  patternList)

Filter directory with multiple patterns.

Parameters
patternListVector of wild card matching patterns
bool zz::fs::Directory::is_recursive ( ) const

Check if directory is resursively searched.

Returns
True if recursive
std::string zz::fs::Directory::root ( ) const

Return root of directory.

Returns
A std::string of absolute root path
std::size_t zz::fs::Directory::size ( ) const
inline

Return number of contained directories or files.

Returns
Size
std::vector< Path > zz::fs::Directory::to_list ( ) const

Return the entire list.

Returns
A std::vector<Path> containing current list

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