mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Adds method getVariableNames to variables
This commit is contained in:
parent
c8d6806a31
commit
f06ce3b394
@ -610,6 +610,7 @@ class Variables : public std::vector<Variable *> {
|
|||||||
return std::find_if(begin(), end(),
|
return std::find_if(begin(), end(),
|
||||||
[v](Variable *m) -> bool { return *v == *m; }) != end();
|
[v](Variable *m) -> bool { return *v == *m; }) != end();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool contains(const VariableValue *v) {
|
bool contains(const VariableValue *v) {
|
||||||
return std::find_if(begin(), end(),
|
return std::find_if(begin(), end(),
|
||||||
[v](Variable *m) -> bool {
|
[v](Variable *m) -> bool {
|
||||||
@ -620,6 +621,19 @@ class Variables : public std::vector<Variable *> {
|
|||||||
return v->getKeyWithCollection() == *m->m_fullName.get();
|
return v->getKeyWithCollection() == *m->m_fullName.get();
|
||||||
}) != end();
|
}) != end();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
std::string getVariableNames(const std::string &sep = ",") {
|
||||||
|
std::string names;
|
||||||
|
for (auto a : *this) {
|
||||||
|
if (names.length() > 0) {
|
||||||
|
names = names + sep + *a->m_fullName;
|
||||||
|
} else {
|
||||||
|
names = *a->m_fullName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return names;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user