The Directory class for filesystem directory operations.
More...
#include <zupply.hpp>
|
using | iterator = std::vector< Path >::iterator |
|
using | const_iterator = std::vector< Path >::const_iterator |
|
|
| 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< Path > | to_list () const |
| Return the entire list. More...
|
|
The Directory class for filesystem directory operations.
zz::fs::Directory::Directory |
( |
std::string |
root, |
|
|
bool |
recursive = false |
|
) |
| |
Directory constructor.
- Parameters
-
root | Root of directory |
recursive | Recursive search or not |
zz::fs::Directory::Directory |
( |
std::string |
root, |
|
|
const std::string |
pattern, |
|
|
bool |
recursive = false |
|
) |
| |
Directory constructor with filter pattern.
- Parameters
-
root | Root of directory |
pattern | Filter pattern |
recursive | Recursive search or not |
zz::fs::Directory::Directory |
( |
std::string |
root, |
|
|
const std::vector< std::string > |
patternList, |
|
|
bool |
recursive |
|
) |
| |
Directory constructor with filter pattern.
- Parameters
-
root | Root of directory |
patternList | Vector of filter patterns |
recursive | Recursive search or not |
zz::fs::Directory::Directory |
( |
std::string |
root, |
|
|
const std::vector< const char * > |
patternList, |
|
|
bool |
recursive |
|
) |
| |
Directory constructor with filter pattern.
- Parameters
-
root | Root of directory |
patternList | Vector of filter patterns |
recursive | Recursive search or not |
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
-
Wild | card matching pattern |
void zz::fs::Directory::filter |
( |
const std::vector< const char * > |
patternList | ) |
|
Filter directory with multiple patterns.
- Parameters
-
patternList | Vector of wild card matching patterns |
void zz::fs::Directory::filter |
( |
const std::vector< std::string > |
patternList | ) |
|
Filter directory with multiple patterns.
- Parameters
-
patternList | Vector 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: