Module: check_mk
Branch: master
Commit: 9f0db9af9be629f7ed4f6606cab309977588985c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f0db9af9be629…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Dec 4 09:36:42 2017 +0100
Renamings only.
Change-Id: Id86a813b1f3a4f6fd5911ddd94b918df26797dd7
---
livestatus/src/AndingFilter.cc | 4 ++--
livestatus/src/AndingFilter.h | 4 ++--
livestatus/src/Filter.cc | 2 +-
livestatus/src/Filter.h | 2 +-
livestatus/src/ListFilter.cc | 4 ++--
livestatus/src/ListFilter.h | 2 +-
livestatus/src/Query.cc | 4 ++--
livestatus/src/Query.h | 2 +-
livestatus/src/StringFilter.cc | 5 ++---
livestatus/src/StringFilter.h | 2 +-
livestatus/src/TableHosts.cc | 2 +-
livestatus/src/TableServices.cc | 8 +++++---
12 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/livestatus/src/AndingFilter.cc b/livestatus/src/AndingFilter.cc
index 28c9d74..6a1a515 100644
--- a/livestatus/src/AndingFilter.cc
+++ b/livestatus/src/AndingFilter.cc
@@ -78,10 +78,10 @@ std::unique_ptr<Filter> AndingFilter::negate() const {
return std::make_unique<OringFilter>(std::move(filters));
}
-const std::string *AndingFilter::findValueForIndexing(
+const std::string *AndingFilter::stringValueRestrictionFor(
const std::string &column_name) const {
for (const auto &filter : _subfilters) {
- if (auto value = filter->valueForIndexing(column_name)) {
+ if (auto value = filter->stringValueRestrictionFor(column_name)) {
return value;
}
}
diff --git a/livestatus/src/AndingFilter.h b/livestatus/src/AndingFilter.h
index 0a542a0..f75d299 100644
--- a/livestatus/src/AndingFilter.h
+++ b/livestatus/src/AndingFilter.h
@@ -50,8 +50,8 @@ public:
std::chrono::seconds timezone_offset) const override;
std::unique_ptr<Filter> copy() const override;
std::unique_ptr<Filter> negate() const override;
- const std::string *findValueForIndexing(
- const std::string &column_name) const;
+ const std::string *stringValueRestrictionFor(
+ const std::string &column_name) const override;
auto begin() const { return _subfilters.begin(); }
auto end() const { return _subfilters.end(); }
diff --git a/livestatus/src/Filter.cc b/livestatus/src/Filter.cc
index 3df6e33..0a23dcc 100644
--- a/livestatus/src/Filter.cc
+++ b/livestatus/src/Filter.cc
@@ -26,7 +26,7 @@
Filter::~Filter() = default;
-const std::string *Filter::valueForIndexing(
+const std::string *Filter::stringValueRestrictionFor(
const std::string & /* column_name */) const {
return nullptr;
}
diff --git a/livestatus/src/Filter.h b/livestatus/src/Filter.h
index ea25f89..d83456c 100644
--- a/livestatus/src/Filter.h
+++ b/livestatus/src/Filter.h
@@ -40,7 +40,7 @@ public:
virtual void accept(FilterVisitor &) const = 0;
virtual bool accepts(Row row, const contact *auth_user,
std::chrono::seconds timezone_offset) const = 0;
- virtual const std::string *valueForIndexing(
+ virtual const std::string *stringValueRestrictionFor(
const std::string &column_name) const;
virtual void findIntLimits(const std::string &column_name, int *lower,
int *upper,
diff --git a/livestatus/src/ListFilter.cc b/livestatus/src/ListFilter.cc
index 09672c2..2c7de07 100644
--- a/livestatus/src/ListFilter.cc
+++ b/livestatus/src/ListFilter.cc
@@ -23,8 +23,8 @@
// Boston, MA 02110-1301 USA.
#include "ListFilter.h"
+#include <strings.h>
#include <algorithm>
-#include <cstring>
#include <sstream>
#include <string>
#include "Filter.h"
@@ -116,7 +116,7 @@ bool ListFilter::accepts(Row row, const contact *auth_user,
return false; // unreachable
}
-const std::string *ListFilter::valueForIndexing(
+const std::string *ListFilter::stringValueRestrictionFor(
const std::string &column_name) const {
switch (_relOp) {
case RelationalOperator::greater_or_equal:
diff --git a/livestatus/src/ListFilter.h b/livestatus/src/ListFilter.h
index 8f49494..c23ce45 100644
--- a/livestatus/src/ListFilter.h
+++ b/livestatus/src/ListFilter.h
@@ -45,7 +45,7 @@ public:
std::string value);
bool accepts(Row row, const contact *auth_user,
std::chrono::seconds timezone_offset) const override;
- const std::string *valueForIndexing(
+ const std::string *stringValueRestrictionFor(
const std::string &column_name) const override;
std::unique_ptr<Filter> copy() const override;
std::unique_ptr<Filter> negate() const override;
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index 58bde3d..a4e2a55 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -721,9 +721,9 @@ void Query::finish(QueryRenderer &q) {
}
}
-const std::string *Query::findValueForIndexing(
+const std::string *Query::stringValueRestrictionFor(
const std::string &column_name) const {
- return _filter->findValueForIndexing(column_name);
+ return _filter->stringValueRestrictionFor(column_name);
}
void Query::findIntLimits(const std::string &column_name, int *lower,
diff --git a/livestatus/src/Query.h b/livestatus/src/Query.h
index f7e713e..a76d634 100644
--- a/livestatus/src/Query.h
+++ b/livestatus/src/Query.h
@@ -67,7 +67,7 @@ public:
const contact *authUser() const { return _auth_user; }
std::chrono::seconds timezoneOffset() const { return _timezone_offset; }
- const std::string *findValueForIndexing(
+ const std::string *stringValueRestrictionFor(
const std::string &column_name) const;
void findIntLimits(const std::string &column_name, int *lower,
int *upper) const;
diff --git a/livestatus/src/StringFilter.cc b/livestatus/src/StringFilter.cc
index ae211da..93e0272 100644
--- a/livestatus/src/StringFilter.cc
+++ b/livestatus/src/StringFilter.cc
@@ -23,9 +23,8 @@
// Boston, MA 02110-1301 USA.
#include "StringFilter.h"
+#include <strings.h>
#include <algorithm>
-#include <cstring>
-#include <sstream>
#include "Filter.h"
#include "Row.h"
#include "StringColumn.h"
@@ -86,7 +85,7 @@ bool StringFilter::accepts(Row row, const contact * /* auth_user */,
return false; // unreachable
}
-const std::string *StringFilter::valueForIndexing(
+const std::string *StringFilter::stringValueRestrictionFor(
const std::string &column_name) const {
switch (_relOp) {
case RelationalOperator::equal:
diff --git a/livestatus/src/StringFilter.h b/livestatus/src/StringFilter.h
index 208e0d3..f3cea37 100644
--- a/livestatus/src/StringFilter.h
+++ b/livestatus/src/StringFilter.h
@@ -43,7 +43,7 @@ public:
std::string value);
bool accepts(Row row, const contact *auth_user,
std::chrono::seconds timezone_offset) const override;
- const std::string *valueForIndexing(
+ const std::string *stringValueRestrictionFor(
const std::string &column_name) const override;
std::unique_ptr<Filter> copy() const override;
std::unique_ptr<Filter> negate() const override;
diff --git a/livestatus/src/TableHosts.cc b/livestatus/src/TableHosts.cc
index ec8544c..245376d 100644
--- a/livestatus/src/TableHosts.cc
+++ b/livestatus/src/TableHosts.cc
@@ -642,7 +642,7 @@ void TableHosts::addColumns(Table *table, const std::string
&prefix,
void TableHosts::answerQuery(Query *query) {
// do we know the host group?
- if (const std::string *value = query->findValueForIndexing("groups")) {
+ if (const std::string *value =
query->stringValueRestrictionFor("groups")) {
if (hostgroup *hg =
find_hostgroup(const_cast<char *>(value->c_str()))) {
for (hostsmember *mem = hg->members; mem != nullptr;
diff --git a/livestatus/src/TableServices.cc b/livestatus/src/TableServices.cc
index 821fb9e..3245a92 100644
--- a/livestatus/src/TableServices.cc
+++ b/livestatus/src/TableServices.cc
@@ -466,7 +466,8 @@ void TableServices::addColumns(Table *table, const std::string
&prefix,
void TableServices::answerQuery(Query *query) {
// do we know the host?
- if (const std::string *value = query->findValueForIndexing("host_name"))
{
+ if (const std::string *value =
+ query->stringValueRestrictionFor("host_name")) {
// Older Nagios headers are not const-correct... :-P
if (host *host = find_host(const_cast<char *>(value->c_str()))) {
for (servicesmember *m = host->services; m != nullptr;
@@ -480,7 +481,7 @@ void TableServices::answerQuery(Query *query) {
}
// do we know the service group?
- if (const std::string *name = query->findValueForIndexing("groups")) {
+ if (const std::string *name =
query->stringValueRestrictionFor("groups")) {
if (servicegroup *sg =
find_servicegroup(const_cast<char *>(name->c_str()))) {
for (servicesmember *m = sg->members; m != nullptr; m = m->next) {
@@ -493,7 +494,8 @@ void TableServices::answerQuery(Query *query) {
}
// do we know the host group?
- if (const std::string *name =
query->findValueForIndexing("host_groups")) {
+ if (const std::string *name =
+ query->stringValueRestrictionFor("host_groups")) {
if (hostgroup *hg = find_hostgroup(const_cast<char *>(name->c_str())))
{
for (hostsmember *m = hg->members; m != nullptr; m = m->next) {
for (servicesmember *smem = m->host_ptr->services;