te::da::Like Class Referenceabstract

It is intended to encode a character string comparison operator with pattern matching. More...

#include <Like.h>

Inheritance diagram for te::da::Like:
te::da::Function te::da::Expression te::common::BaseVisitable< QueryVisitor >

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...
 
Expressionclone () const
 It creates a new copy of this expression. More...
 
ExpressiongetArg (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...
 
ExpressiongetString () 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...
 
Likeoperator= (const Like &rhs)
 
Expressionoperator[] (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...
 

Detailed Description

It is intended to encode a character string comparison operator with pattern matching.

See also
Function

Definition at line 43 of file Like.h.

Member Typedef Documentation

◆ ReturnType

typedef void te::common::BaseVisitable< QueryVisitor , void >::ReturnType
inherited

Definition at line 58 of file BaseVisitable.h.

◆ VisitorType

Definition at line 57 of file BaseVisitable.h.

Constructor & Destructor Documentation

◆ Like() [1/3]

TE_DEFINE_VISITABLE te::da::Like::Like ( Expression str,
const std::string &  pattern,
const std::string &  wildCard = "%",
const std::string &  singleChar = "_" 
)

Constructor.

Parameters
strThe operator will take the expression ownership.

◆ Like() [2/3]

te::da::Like::Like ( const Expression str,
const std::string &  pattern,
const std::string &  wildCard = "%",
const std::string &  singleChar = "_" 
)

Constructor.

◆ ~Like()

te::da::Like::~Like ( )

Destructor.

◆ Like() [3/3]

te::da::Like::Like ( const Like rhs)

Copy constructor.

Member Function Documentation

◆ accept()

virtual ReturnType te::common::BaseVisitable< QueryVisitor , void >::accept ( VisitorType guest) const
pure virtualinherited

It call the visit method from the guest object.

Parameters
guestThe guest or visitor.
Returns
Any valid value define by the template type R.

◆ add()

void te::da::Function::add ( Expression arg)
inherited

It adds the argument to the function list of arguments.

Parameters
argThe argument to be added.
Note
The Function will take the ownership of the given argument.

◆ clone()

Expression* te::da::Like::clone ( ) const
virtual

It creates a new copy of this expression.

Reimplemented from te::da::Function.

◆ getArg()

Expression* te::da::Function::getArg ( std::size_t  i) const
inherited

It returns the i-th function argument.

Parameters
iThe argument position.
Returns
The it-th function argument.

◆ getEscapeChar()

const std::string& te::da::Like::getEscapeChar ( ) const

It returns the escape character.

Returns
The escape character.

◆ getName()

const std::string& te::da::Function::getName ( ) const
inlineinherited

It returns the function name.

Returns
The function name.

Definition at line 79 of file Function.h.

◆ getNumArgs()

std::size_t te::da::Function::getNumArgs ( ) const
inherited

It returns the number of arguments informed to the function.

Returns
The number of parameters.

◆ getPattern()

const std::string& te::da::Like::getPattern ( )

It returns the pattern used in the comparison.

Returns
The pattern used in the comparison.

◆ getSingleChar()

const std::string& te::da::Like::getSingleChar ( ) const

It returns the single wild character.

Returns
The single wild character.

◆ getString()

Expression* te::da::Like::getString ( ) const

It returns the string expression to be compared with the like operator.

Returns
The string expression to be compared with the like operator.

◆ getWildCard()

const std::string& te::da::Like::getWildCard ( ) const

It returns the wild character.

Returns
The wild character.

◆ operator=()

Like& te::da::Like::operator= ( const Like rhs)

Assignment operator.

◆ operator[]()

Expression* te::da::Function::operator[] ( std::size_t  i) const
inherited

It returns the i-th function argument.

Parameters
iThe argument position.
Returns
The it-th function argument.

◆ setEscapeChar()

void te::da::Like::setEscapeChar ( const std::string &  e)

It sets the escape character.

Parameters
eThe escape character.

◆ setPattern()

void te::da::Like::setPattern ( const std::string &  p)

It sets the pattern to be used in the comparison.

Parameters
pThe pattern to be used in the comparison.

◆ setSingleChar()

void te::da::Like::setSingleChar ( const std::string &  s)

It sets the wild single character.

Parameters
sThe wild single character.

◆ setString()

void te::da::Like::setString ( Expression str)

It sets the string expression to be compared with the like operator.

Parameters
strThe string expression to be compared with the like operator.

◆ setWildCard()

void te::da::Like::setWildCard ( const std::string &  w)

It sets the wild character.

Parameters
wThe wild character.

Member Data Documentation

◆ m_args

std::vector<Expression*> te::da::Function::m_args
protectedinherited

The list of arguments.

Definition at line 118 of file Function.h.

◆ m_escapeChar

std::string te::da::Like::m_escapeChar
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.

◆ m_name

std::string te::da::Function::m_name
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.

◆ m_pattern

std::string te::da::Like::m_pattern
private

The literal string pattern.

Definition at line 151 of file Like.h.

◆ m_singleChar

std::string te::da::Like::m_singleChar
private

The single char character matches exactly one character.

Definition at line 153 of file Like.h.

◆ m_wildCard

std::string te::da::Like::m_wildCard
private

The wild card character matches zero or more characters.

Definition at line 152 of file Like.h.


The documentation for this class was generated from the following file: