PropertyIsLike.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file PropertyIsLike.h
22 
23  \brief It is intended to encode a character string comparison operator with pattern matching.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_PROPERTYISLIKE_H
27 #define __TERRALIB_FE_INTERNAL_PROPERTYISLIKE_H
28 
29 // TerraLib
30 #include "ComparisonOp.h"
31 
32 // STL
33 #include <string>
34 
35 namespace te
36 {
37  namespace fe
38  {
39 // Forward declarations
40  class Literal;
41  class PropertyName;
42 
43  /*!
44  \class PropertyIsLike
45 
46  \brief It is intended to encode a character string comparison operator with pattern matching.
47 
48  The pattern is defined by a combination of regular
49  characters, the wildCard character, the singleChar
50  character, and the escapeChar character. The wildCard
51  character matches zero or more characters. The singleChar
52  character matches exactly one character.
53 
54  \ingroup fe
55 
56  \sa ComparisonOp, PropertyName, Literal
57  */
59  {
60  public:
61 
63 
64  /** @name Initializer Methods
65  * Methods related to instantiation and destruction.
66  */
67  //@{
68 
69  /*! \brief It initializes a new PropertyIsLike. */
71 
72  /*! \brief Destructor. */
73  ~PropertyIsLike();
74 
75  //@}
76 
77  /** @name Accessor methods
78  * Methods used to get or set properties.
79  */
80  //@{
81 
82  /*!
83  \brief It sets the property name.
84 
85  \param p The property name.
86 
87  \note It will take the ownership of the property name.
88  */
89  void setPropertyName(PropertyName* p);
90 
91  /*!
92  \brief It returns the property name.
93 
94  \return The property name.
95  */
96  PropertyName* getPropertyName() const;
97 
98  /*!
99  \brief It sets the literal value of the operator.
100 
101  \param l The literal value of the operator.
102 
103  \note It will take the ownership of the literal value.
104  */
105  void setLiteral(Literal* l);
106 
107  /*!
108  \brief It returns the literal value.
109 
110  \return The literal value.
111  */
112  Literal* getLiteral() const;
113 
114  /*!
115  \brief It sets the wild character.
116 
117  \param w The wild character.
118  */
119  void setWildCard(const std::string& w);
120 
121  /*!
122  \brief It returns the wild character.
123 
124  \return The wild character.
125  */
126  const std::string& getWildCard() const;
127 
128  /*!
129  \brief It sets the wild single character.
130 
131  \param s The wild single character.
132  */
133  void setSingleChar(const std::string& s);
134 
135  /*!
136  \brief It returns the single wild character.
137 
138  \return The single wild character.
139  */
140  const std::string& getSingleChar() const;
141 
142  /*!
143  \brief It sets the escape character.
144 
145  \param e The escape character.
146  */
147  void setEscapeChar(const std::string& e);
148 
149  /*!
150  \brief It returns the escape character.
151 
152  \return The escape character.
153  */
154  const std::string& getEscapeChar() const;
155 
156  //@}
157 
158  private:
159 
160  PropertyName* m_property; //!< Mandatory.
161  Literal* m_literalValue; //!< Mandatory.
162  std::string m_wildCard; //!< The wildCard_ character matches zero or more characters. (Mandatory)
163  std::string m_singleChar; //!< The singleChar_ character matches exactly one character. (Mandatory)
164  std::string m_escapeChar; //!< The escapeChar_ character is used to escape the meaning of the wildCard_, singleChar_ and escapeChar_ itself. (Mandatory.)
165  };
166 
167  } // end namespace fe
168 } // end namespace te
169 
170 #endif // __TERRALIB_FE_INTERNAL_PROPERTYISLIKE_H
std::string m_singleChar
The singleChar_ character matches exactly one character. (Mandatory)
std::string m_escapeChar
The escapeChar_ character is used to escape the meaning of the wildCard_, singleChar_ and escapeChar_...
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:49
Literal * m_literalValue
Mandatory.
PropertyName * m_property
Mandatory.
It is intended to encode a character string comparison operator with pattern matching.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
URI C++ Library.
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
This class can be used to represent literal values.
Definition: Literal.h:56
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
std::string m_wildCard
The wildCard_ character matches zero or more characters. (Mandatory)