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 25 of file JGlob.hh.
◆ JGlob() [1/3]
| JSYSTEM::JGlob::JGlob |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 31 of file JGlob.hh.
◆ JGlob() [2/3]
| JSYSTEM::JGlob::JGlob |
( |
const std::string & | pattern | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 40 of file JGlob.hh.
41 {
42 (*this)(pattern);
43 }
◆ JGlob() [3/3]
| JSYSTEM::JGlob::JGlob |
( |
const std::vector< std::string > & | buffer | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 51 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 63 of file JGlob.hh.
64 {
65 this->clear();
66
68
69 return *this;
70 }
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 80 of file JGlob.hh.
81 {
82 this->clear();
83
84 for (
const std::string& pattern :
buffer) {
86 }
87
88 return *this;
89 }
◆ push_back()
| void JSYSTEM::JGlob::push_back |
( |
const std::string & | file_name | ) |
|
|
inline |
Push back file.
This method constitutes a light weight wrapper to resolve symbolic links on the fly.
- Parameters
-
Definition at line 98 of file JGlob.hh.
99 {
101 }
std::filesystem::path resolveSymlink(const std::filesystem::path &file_name)
Resolve symbolic links.
◆ evaluate()
| void JSYSTEM::JGlob::evaluate |
( |
const std::string & | pattern | ) |
|
|
inlineprivate |
Process pattern.
- Parameters
-
Definition at line 109 of file JGlob.hh.
110 {
112
113 const int value = glob(pattern.c_str(), GLOB_TILDE | GLOB_BRACE, NULL, &
buffer);
114
115 if (value == 0) {
116
117 for(
size_t i = 0; i <
buffer.gl_pathc; ++i) {
119 }
120
121 } else {
122
124 }
125
127 }
void push_back(const std::string &file_name)
Push back file.
◆ buffer
| glob_t JSYSTEM::JGlob::buffer |
|
private |
The documentation for this struct was generated from the following file: