Auxiliary class to list files.
More...
#include <JGlob.hh>
|
void | evaluate (const std::string &pattern) |
| Process pattern.
|
|
Auxiliary class to list files.
Definition at line 23 of file JGlob.hh.
◆ JGlob() [1/3]
JSYSTEM::JGlob::JGlob |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 29 of file JGlob.hh.
◆ JGlob() [2/3]
JSYSTEM::JGlob::JGlob |
( |
const std::string & | pattern | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 38 of file JGlob.hh.
39 {
40 (*this)(pattern);
41 }
◆ JGlob() [3/3]
JSYSTEM::JGlob::JGlob |
( |
const std::vector< std::string > & | buffer | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 49 of file JGlob.hh.
◆ operator()() [1/2]
const JGlob & JSYSTEM::JGlob::operator() |
( |
const std::string & | pattern | ) |
|
|
inline |
Get list of files.
- Parameters
-
- Returns
- list of files
Definition at line 61 of file JGlob.hh.
62 {
63 this->clear();
64
66
67 return *this;
68 }
void evaluate(const std::string &pattern)
Process pattern.
◆ operator()() [2/2]
const JGlob & JSYSTEM::JGlob::operator() |
( |
const std::vector< std::string > & | buffer | ) |
|
|
inline |
Get list of files.
- Parameters
-
- Returns
- list of files
Definition at line 78 of file JGlob.hh.
79 {
80 this->clear();
81
82 for (
const std::string& pattern :
buffer) {
84 }
85
86 return *this;
87 }
◆ evaluate()
void JSYSTEM::JGlob::evaluate |
( |
const std::string & | pattern | ) |
|
|
inlineprivate |
Process pattern.
- Parameters
-
Definition at line 96 of file JGlob.hh.
97 {
99
100 const int value = glob(pattern.c_str(), GLOB_TILDE | GLOB_BRACE, NULL, &
buffer);
101
102 if (value == 0) {
103
104 for(
size_t i = 0; i <
buffer.gl_pathc; ++i) {
105 this->push_back(
buffer.gl_pathv[i]);
106 }
107
108 } else {
109
110 this->push_back(pattern);
111 }
112
114 }
◆ buffer
glob_t JSYSTEM::JGlob::buffer |
|
private |
The documentation for this struct was generated from the following file: