diff options
Diffstat (limited to 'cpp/src/qpid/log/Selector.cpp')
-rw-r--r-- | cpp/src/qpid/log/Selector.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/qpid/log/Selector.cpp b/cpp/src/qpid/log/Selector.cpp index 994421d0ff..a4bc580470 100644 --- a/cpp/src/qpid/log/Selector.cpp +++ b/cpp/src/qpid/log/Selector.cpp @@ -16,10 +16,11 @@ * */ -#include "Selector.h" -#include "Options.h" +#include "qpid/log/Selector.h" +#include "qpid/log/Options.h" #include <boost/bind.hpp> #include <algorithm> +#include <string.h> namespace qpid { namespace log { @@ -52,12 +53,13 @@ Selector::Selector(const Options& opt){ boost::bind(&Selector::enable, this, _1)); } -bool Selector::isEnabled(Level level, const std::string& function) { +bool Selector::isEnabled(Level level, const char* function) { + const char* functionEnd = function+::strlen(function); for (std::vector<std::string>::iterator i=substrings[level].begin(); i != substrings[level].end(); ++i) { - if (function.find(*i) != std::string::npos) + if (std::search(function, functionEnd, i->begin(), i->end()) != functionEnd) return true; } return false; |