Loading...
Searching...
No Matches
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
35namespace 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. */
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 */
90
91 /*!
92 \brief It returns the property name.
93
94 \return The property name.
95 */
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 */
106
107 /*!
108 \brief It returns the literal value.
109
110 \return The literal value.
111 */
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 /*! \brief It creates a new copy of this object. */
160
161 private:
162
163 PropertyName* m_property; //!< Mandatory.
164 Literal* m_literalValue; //!< Mandatory.
165 std::string m_wildCard; //!< The wildCard_ character matches zero or more characters. (Mandatory)
166 std::string m_singleChar; //!< The singleChar_ character matches exactly one character. (Mandatory)
167 std::string m_escapeChar; //!< The escapeChar_ character is used to escape the meaning of the wildCard_, singleChar_ and escapeChar_ itself. (Mandatory.)
168 };
169
170 } // end namespace fe
171} // end namespace te
172
173#endif // __TERRALIB_FE_INTERNAL_PROPERTYISLIKE_H
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:50
This class can be used to represent literal values.
Definition: Literal.h:57
It is intended to encode a character string comparison operator with pattern matching.
Literal * m_literalValue
Mandatory.
~PropertyIsLike()
Destructor.
void setWildCard(const std::string &w)
It sets the wild character.
PropertyName * getPropertyName() const
It returns the property name.
std::string m_wildCard
The wildCard_ character matches zero or more characters. (Mandatory)
const std::string & getWildCard() const
It returns the wild character.
std::string m_singleChar
The singleChar_ character matches exactly one character. (Mandatory)
const std::string & getSingleChar() const
It returns the single wild character.
Literal * getLiteral() const
It returns the literal value.
std::string m_escapeChar
The escapeChar_ character is used to escape the meaning of the wildCard_, singleChar_ and escapeChar_...
void setEscapeChar(const std::string &e)
It sets the escape character.
PropertyIsLike()
It initializes a new PropertyIsLike.
ComparisonOp * clone() const
It creates a new copy of this object.
PropertyName * m_property
Mandatory.
void setLiteral(Literal *l)
It sets the literal value of the operator.
void setPropertyName(PropertyName *p)
It sets the property name.
void setSingleChar(const std::string &s)
It sets the wild single character.
const std::string & getEscapeChar() const
It returns the escape character.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:55
TerraLib.
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59