It is intended to encode a character string comparison operator with pattern matching. More...
#include <Like.h>
Public Types | |
| typedef void | ReturnType |
| typedef QueryVisitor | VisitorType |
Public Member Functions | |
| virtual ReturnType | accept (VisitorType &guest) const =0 |
| It call the visit method from the guest object. More... | |
| void | add (Expression *arg) |
| It adds the argument to the function list of arguments. More... | |
| Expression * | clone () const |
| It creates a new copy of this expression. More... | |
| Expression * | getArg (std::size_t i) const |
| It returns the i-th function argument. More... | |
| const std::string & | getEscapeChar () const |
| It returns the escape character. More... | |
| const std::string & | getName () const |
| It returns the function name. More... | |
| std::size_t | getNumArgs () const |
| It returns the number of arguments informed to the function. More... | |
| const std::string & | getPattern () |
| It returns the pattern used in the comparison. More... | |
| const std::string & | getSingleChar () const |
| It returns the single wild character. More... | |
| Expression * | getString () const |
| It returns the string expression to be compared with the like operator. More... | |
| const std::string & | getWildCard () const |
| It returns the wild character. More... | |
| TE_DEFINE_VISITABLE | Like (Expression *str, const std::string &pattern, const std::string &wildCard="%", const std::string &singleChar="_", const std::string &escapeChar="\\") |
| Constructor. More... | |
| Like (const Expression &str, const std::string &pattern, const std::string &wildCard="%", const std::string &singleChar="_", const std::string &escapeChar="\\") | |
| Constructor. More... | |
| Like (const Like &rhs) | |
| Copy constructor. More... | |
| Like & | operator= (const Like &rhs) |
| Expression * | operator[] (std::size_t i) const |
| It returns the i-th function argument. More... | |
| void | setEscapeChar (const std::string &e) |
| It sets the escape character. More... | |
| void | setPattern (const std::string &p) |
| It sets the pattern to be used in the comparison. More... | |
| void | setSingleChar (const std::string &s) |
| It sets the wild single character. More... | |
| void | setString (Expression *str) |
| It sets the string expression to be compared with the like operator. More... | |
| void | setWildCard (const std::string &w) |
| It sets the wild character. More... | |
| ~Like () | |
| Destructor. More... | |
Protected Attributes | |
| std::vector< Expression * > | m_args |
| The list of arguments. More... | |
| std::string | m_name |
| The function name. May be an operator symbol or just a regular name like ST_Intersects. More... | |
Private Attributes | |
| std::string | m_escapeChar |
| The escape char character is used to escape the meaning of the wild card, single char and escape char itself. More... | |
| std::string | m_pattern |
| The literal string pattern. More... | |
| std::string | m_singleChar |
| The single char character matches exactly one character. More... | |
| std::string | m_wildCard |
| The wild card character matches zero or more characters. More... | |
It is intended to encode a character string comparison operator with pattern matching.
|
inherited |
Definition at line 58 of file BaseVisitable.h.
|
inherited |
Definition at line 57 of file BaseVisitable.h.
| te::da::Like::Like | ( | Expression * | str, |
| const std::string & | pattern, | ||
| const std::string & | wildCard = "%", |
||
| const std::string & | singleChar = "_", |
||
| const std::string & | escapeChar = "\\" |
||
| ) |
Constructor.
| str | The operator will take the expression ownership. |
Definition at line 35 of file Like.cpp.
References te::da::Function::m_args.
| te::da::Like::Like | ( | const Expression & | str, |
| const std::string & | pattern, | ||
| const std::string & | wildCard = "%", |
||
| const std::string & | singleChar = "_", |
||
| const std::string & | escapeChar = "\\" |
||
| ) |
Constructor.
Definition at line 49 of file Like.cpp.
References te::da::Expression::clone(), and te::da::Function::m_args.
|
pure virtualinherited |
It call the visit method from the guest object.
| guest | The guest or visitor. |
|
inherited |
It adds the argument to the function list of arguments.
| arg | The argument to be added. |
Definition at line 79 of file Function.cpp.
Referenced by te::map::QueryEncoder::getExpression(), te::da::ObjectIdSet::getExpression(), and te::map::QueryEncoder::visit().
|
virtual |
It creates a new copy of this expression.
Reimplemented from te::da::Function.
|
inherited |
It returns the i-th function argument.
| i | The argument position. |
Definition at line 67 of file Function.cpp.
Referenced by te::da::SpatialRestrictionVisitor::getGeometryRestriction(), te::da::SpatialRestrictionVisitor::getPropertyName(), te::da::SpatialRestrictionVisitor::isFromEnvelope(), and te::serialize::xml::Save().
| const std::string & te::da::Like::getEscapeChar | ( | ) | const |
|
inlineinherited |
It returns the function name.
Definition at line 79 of file Function.h.
Referenced by te::da::AttributeRestrictionVisitor::getOperator(), te::da::SpatialRestrictionVisitor::getSpatialRelation(), te::da::AttributeRestrictionVisitor::isAttributeRestrictionFunction(), te::da::SpatialRestrictionVisitor::isSpatialRestrictionFunction(), te::serialize::xml::Save(), te::da::SpatialQueryProcessor::supportsSpatialTopologicOperatos(), and te::da::SQLVisitor::visit().
|
inherited |
It returns the number of arguments informed to the function.
Definition at line 62 of file Function.cpp.
Referenced by te::da::SpatialRestrictionVisitor::getGeometryRestriction(), te::da::SpatialRestrictionVisitor::getPropertyName(), te::da::SpatialRestrictionVisitor::isFromEnvelope(), te::serialize::xml::Save(), te::da::FunctionNoArgsEncoder::toSQL(), te::da::BinaryOpEncoder::toSQL(), te::da::UnaryOpEncoder::toSQL(), te::da::FunctionEncoder::toSQL(), te::da::TemplateEncoder::toSQL(), te::da::AttributeRestrictionVisitor::visit(), te::da::SpatialRestrictionVisitor::visit(), and te::da::SQLVisitor::visit().
| const std::string & te::da::Like::getPattern | ( | ) |
| const std::string & te::da::Like::getSingleChar | ( | ) | const |
| te::da::Expression * te::da::Like::getString | ( | ) | const |
| const std::string & te::da::Like::getWildCard | ( | ) | const |
| te::da::Like & te::da::Like::operator= | ( | const Like & | rhs | ) |
Assignment operator.
Definition at line 76 of file Like.cpp.
References m_escapeChar, m_pattern, m_singleChar, m_wildCard, and te::da::Function::operator=().
|
inherited |
It returns the i-th function argument.
| i | The argument position. |
Definition at line 73 of file Function.cpp.
| void te::da::Like::setEscapeChar | ( | const std::string & | e | ) |
| void te::da::Like::setPattern | ( | const std::string & | p | ) |
| void te::da::Like::setSingleChar | ( | const std::string & | s | ) |
| void te::da::Like::setString | ( | Expression * | str | ) |
| void te::da::Like::setWildCard | ( | const std::string & | w | ) |
|
protectedinherited |
The list of arguments.
Definition at line 118 of file Function.h.
Referenced by te::da::BinaryFunction::BinaryFunction(), te::da::Function::Function(), Like(), te::da::Function::operator=(), te::da::ST_Buffer::ST_Buffer(), te::da::ST_DistanceBuffer::ST_DistanceBuffer(), te::da::ST_Relate::ST_Relate(), te::da::ST_Transform::ST_Transform(), te::da::Substring::Substring(), and te::da::UnaryFunction::UnaryFunction().
|
private |
The escape char character is used to escape the meaning of the wild card, single char and escape char itself.
Definition at line 154 of file Like.h.
Referenced by operator=().
|
protectedinherited |
The function name. May be an operator symbol or just a regular name like ST_Intersects.
Definition at line 117 of file Function.h.
Referenced by te::da::Function::operator=().
|
private |
|
private |
The single char character matches exactly one character.
Definition at line 153 of file Like.h.
Referenced by operator=().
|
private |
The wild card character matches zero or more characters.
Definition at line 152 of file Like.h.
Referenced by operator=().