It is intended to encode a character string comparison operator with pattern matching.
More...
#include <Like.h>
|
virtual ReturnType | accept (VisitorType &guest) const=0 |
| It call the visit method from the guest object.
|
|
void | add (Expression *arg) |
| It adds the argument to the function list of arguments.
|
|
Expression * | clone () const |
| It creates a new copy of this expression.
|
|
Expression * | getArg (std::size_t i) const |
| It returns the i-th function argument.
|
|
const std::string & | getEscapeChar () const |
| It returns the escape character.
|
|
const std::string & | getName () const |
| It returns the function name.
|
|
std::size_t | getNumArgs () const |
| It returns the number of arguments informed to the function.
|
|
te::da::LiteralString * | getPattern () const |
| It returns the pattern used in the comparison.
|
|
const std::string & | getSingleChar () const |
| It returns the single wild character.
|
|
Expression * | getString () const |
| It returns the string expression to be compared with the like operator.
|
|
const std::string & | getWildCard () const |
| It returns the wild character.
|
|
| Like (const Expression &str, const std::string &pattern, const std::string &wildCard="%", const std::string &singleChar="_", const std::string &escapeChar="\\") |
| Constructor.
|
|
| Like (const Like &rhs) |
| Copy constructor.
|
|
TE_DEFINE_VISITABLE | Like (Expression *str, const std::string &pattern, const std::string &wildCard="%", const std::string &singleChar="_", const std::string &escapeChar="\\") |
| Constructor.
|
|
Like & | operator= (const Like &rhs) |
|
Expression * | operator[] (std::size_t i) const |
| It returns the i-th function argument.
|
|
void | setEscapeChar (const std::string &e) |
| It sets the escape character.
|
|
void | setPattern (const std::string &p) |
| It sets the pattern to be used in the comparison.
|
|
void | setSingleChar (const std::string &s) |
| It sets the wild single character.
|
|
void | setString (Expression *str) |
| It sets the string expression to be compared with the like operator.
|
|
void | setWildCard (const std::string &w) |
| It sets the wild character.
|
|
| ~Like () |
| Destructor.
|
|
|
std::string | m_escapeChar |
| The escape char character is used to escape the meaning of the wild card, single char and escape char itself.
|
|
std::string | m_singleChar |
| The single char character matches exactly one character.
|
|
std::string | m_wildCard |
| The wild card character matches zero or more characters.
|
|
It is intended to encode a character string comparison operator with pattern matching.
- See also
- Function
Definition at line 43 of file Like.h.
◆ ReturnType
◆ VisitorType
◆ Like() [1/3]
TE_DEFINE_VISITABLE te::da::Like::Like |
( |
Expression * |
str, |
|
|
const std::string & |
pattern, |
|
|
const std::string & |
wildCard = "%" , |
|
|
const std::string & |
singleChar = "_" , |
|
|
const std::string & |
escapeChar = "\\" |
|
) |
| |
Constructor.
- Parameters
-
str | The 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 = "_" , |
|
|
const std::string & |
escapeChar = "\\" |
|
) |
| |
◆ ~Like()
◆ Like() [3/3]
te::da::Like::Like |
( |
const Like & |
rhs | ) |
|
◆ accept()
It call the visit method from the guest object.
- Parameters
-
guest | The guest or visitor. |
- Returns
- Any valid value define by the template type R.
◆ add()
It adds the argument to the function list of arguments.
- Parameters
-
arg | The argument to be added. |
- Note
- The Function will take the ownership of the given argument.
◆ clone()
◆ getArg()
Expression * te::da::Function::getArg |
( |
std::size_t |
i | ) |
const |
|
inherited |
It returns the i-th function argument.
- Parameters
-
- 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()
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()
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 | ) |
|
◆ operator[]()
Expression * te::da::Function::operator[] |
( |
std::size_t |
i | ) |
const |
|
inherited |
It returns the i-th function argument.
- Parameters
-
- Returns
- The it-th function argument.
◆ setEscapeChar()
void te::da::Like::setEscapeChar |
( |
const std::string & |
e | ) |
|
It sets the escape character.
- Parameters
-
◆ setPattern()
void te::da::Like::setPattern |
( |
const std::string & |
p | ) |
|
It sets the pattern to be used in the comparison.
- Parameters
-
p | The pattern to be used in the comparison. |
◆ setSingleChar()
void te::da::Like::setSingleChar |
( |
const std::string & |
s | ) |
|
It sets the wild single character.
- Parameters
-
s | The wild single character. |
◆ setString()
It sets the string expression to be compared with the like operator.
- Parameters
-
str | The 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
-
◆ m_args
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 153 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_singleChar
std::string te::da::Like::m_singleChar |
|
private |
The single char character matches exactly one character.
Definition at line 152 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 151 of file Like.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_release/src/terralib/dataaccess/query/Like.h