From acca1c66a3a3c8292e22aa6a77b62c772ed4f89a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 14 Oct 2014 01:23:55 -0400 Subject: [PATCH] CLI - Implemented ::getFilter. --- src/CLI.cpp | 24 ++++++++++++++++++++++++ src/CLI.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/CLI.cpp b/src/CLI.cpp index 6c32c983f..579a15a33 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -232,6 +232,30 @@ bool CLI::canonicalize ( return false; } +//////////////////////////////////////////////////////////////////////////////// +const std::string CLI::getFilter () const +{ + std::string filter = ""; + + if (_filter.size ()) + { + filter = "("; + + std::vector ::const_iterator i; + for (i = _filter.begin (); i != _filter.end (); ++i) + { + if (i != _filter.begin ()) + filter += ' '; + + filter += *i; + } + + filter += ')'; + } + + return filter; +} + //////////////////////////////////////////////////////////////////////////////// void CLI::dump (const std::string& label) const { diff --git a/src/CLI.h b/src/CLI.h index 9750dfd6f..29e2ab499 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -42,6 +42,7 @@ public: void categorize (); bool exactMatch (const std::string&, const std::string&) const; bool canonicalize (std::string&, const std::string&, const std::string&) const; + const std::string getFilter () const; private: void extractOverrides ();