All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PropertyIsLike.cpp
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.cpp
22 
23  \brief It is intended to encode a character string comparison operator with pattern matching.
24  */
25 
26 // TerraLib
27 #include "Globals.h"
28 #include "Literal.h"
29 #include "PropertyIsLike.h"
30 #include "PropertyName.h"
31 
33  : ComparisonOp(Globals::sm_propertyIsLike),
34  m_property(0),
35  m_literalValue(0)
36 {
37 }
38 
40 {
41  delete m_property;
42  delete m_literalValue;
43 }
44 
46 {
47  delete m_property;
48  m_property = p;
49 }
50 
52 {
53  return m_property;
54 }
55 
57 {
58  delete m_literalValue;
59  m_literalValue = l;
60 }
61 
63 {
64  return m_literalValue;
65 }
66 
67 void te::fe::PropertyIsLike::setWildCard(const std::string& w)
68 {
69  m_wildCard = w;
70 }
71 
72 const std::string& te::fe::PropertyIsLike::getWildCard() const
73 {
74  return m_wildCard;
75 }
76 
77 void te::fe::PropertyIsLike::setSingleChar(const std::string& s)
78 {
79  m_singleChar = s;
80 }
81 
82 const std::string& te::fe::PropertyIsLike::getSingleChar() const
83 {
84  return m_singleChar;
85 }
86 
87 void te::fe::PropertyIsLike::setEscapeChar(const std::string& e)
88 {
89  m_escapeChar = e;
90 }
91 
92 const std::string& te::fe::PropertyIsLike::getEscapeChar() const
93 {
94  return m_escapeChar;
95 }
96 
void setLiteral(Literal *l)
It sets the literal value of the operator.
PropertyName * getPropertyName() const
It returns the property name.
const std::string & getWildCard() const
It returns the wild character.
This class can be used to represent literal values.
A comparison operator is used to form expressions that evaluate the mathematical comparison between t...
Definition: ComparisonOp.h:49
void setEscapeChar(const std::string &e)
It sets the escape character.
void setWildCard(const std::string &w)
It sets the wild character.
Literal * getLiteral() const
It returns the literal value.
const std::string & getSingleChar() const
It returns the single wild character.
PropertyIsLike()
It initializes a new PropertyIsLike.
void setSingleChar(const std::string &s)
It sets the wild single character.
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
An static class with global definitions.
Definition: Globals.h:43
const std::string & getEscapeChar() const
It returns the escape character.
~PropertyIsLike()
Destructor.
void setPropertyName(PropertyName *p)
It sets the property name.
An static class with global definitions.
This class can be used to represent literal values.
Definition: Literal.h:56
It is intended to encode a character string comparison operator with pattern matching.