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 24 of file JGlob.hh.
◆ JGlob() [1/3]
| JSYSTEM::JGlob::JGlob |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 30 of file JGlob.hh.
◆ JGlob() [2/3]
| JSYSTEM::JGlob::JGlob |
( |
const std::string & | pattern | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 39 of file JGlob.hh.
40 {
41 (*this)(pattern);
42 }
◆ JGlob() [3/3]
| JSYSTEM::JGlob::JGlob |
( |
const std::vector< std::string > & | buffer | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 50 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 62 of file JGlob.hh.
63 {
64 this->clear();
65
67
68 return *this;
69 }
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 79 of file JGlob.hh.
80 {
81 this->clear();
82
83 for (
const std::string& pattern :
buffer) {
85 }
86
87 return *this;
88 }
◆ 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 97 of file JGlob.hh.
98 {
99 using namespace std::filesystem;
100
101 path ps(file_name);
102
103 if (is_symlink(ps)) {
104 ps = read_symlink(ps);
105 }
106
108 }
◆ evaluate()
| void JSYSTEM::JGlob::evaluate |
( |
const std::string & | pattern | ) |
|
|
inlineprivate |
Process pattern.
- Parameters
-
Definition at line 116 of file JGlob.hh.
117 {
119
120 const int value = glob(pattern.c_str(), GLOB_TILDE | GLOB_BRACE, NULL, &
buffer);
121
122 if (value == 0) {
123
124 for(
size_t i = 0; i <
buffer.gl_pathc; ++i) {
126 }
127
128 } else {
129
131 }
132
134 }
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: