CARMA C++
StringFilter.h
Go to the documentation of this file.
1 #ifndef CARMA_DBMS_STRINGFILTER_H
2 #define CARMA_DBMS_STRINGFILTER_H
3 
15 #include <string>
16 #include <sstream>
19 
20 namespace carma {
21 namespace dbms {
22 
31 
32 public:
33 
41  typedef enum {
42  EQUAL_TO,
43  LIKE
44  }
45  SearchType;
46 
52  StringFilter(const std::string& value, const SearchType& searchType);
53 
57  virtual ~StringFilter();
58 
63  std::string getValue() const;
64 
69  SearchType getSearchType() const;
70 
71  //std::string toString() const;
72 
80  std::string toString(const std::string& tableName,
81  const std::string& columnName) const;
82 
87  virtual std::string name() const;
88 
89 protected:
90  std::string value_;
91  SearchType searchType_;
92 };
93 
94 
95 }}
96 
97 #endif // CARMA_DBMS_STRINGFILTER_H
98 
abstract base class to represent an SQL query one component filter (part of a WHERE clause) ...
std::string toString(const std::string &tableName, const std::string &columnName) const
string representation of the filter.
virtual std::string name() const
get the class name for log messages etc.
abstract base class to represent a simple one component filter
virtual ~StringFilter()
destructor, derived classes may want to override
header that defines a number of common exceptions by including their header files.
StringFilter(const std::string &value, const SearchType &searchType)
constuctor
template to represent a one component string filter.
Definition: StringFilter.h:30
SearchType
type of search to perform
Definition: StringFilter.h:41
std::string getValue() const
get the value of the search
SearchType getSearchType() const
get the search type