ANNA Suite  2020b
Multipurpose development suite for Telco applications
Public Member Functions | List of all members
anna::RegularExpression Class Reference

#include <RegularExpression.hpp>

Public Member Functions

 RegularExpression (const std::string &pattern="")
 
 ~RegularExpression ()
 
void setPattern (const std::string &pattern)
 
const std::string & getPattern (void) const
 
bool isLike (const std::string &value)
 
bool match (const std::string &value)
 
bool operator== (const RegularExpression &re) const
 
bool operator< (const RegularExpression &re) const
 

Detailed Description

Class helper to manage regular expressions with efficiency (first compile & keep pattern, then reuse match procedure with different values)

Constructor & Destructor Documentation

◆ RegularExpression()

anna::RegularExpression::RegularExpression ( const std::string &  pattern = "")
inline
40 : a_pattern(pattern), a_compiled(false) {};

◆ ~RegularExpression()

anna::RegularExpression::~RegularExpression ( )
inline
41 { freeRegex(); }
Here is the call graph for this function:

Member Function Documentation

◆ getPattern()

const std::string& anna::RegularExpression::getPattern ( void  ) const
inline

Get the current pattern for the regular expression

Returns
Pattern
61 { return a_pattern; }
Here is the call graph for this function:

◆ isLike()

bool anna::RegularExpression::isLike ( const std::string &  value)

Check if value fulfill regular expression

Returns
Boolean about if value provided match regular expression

◆ match()

bool anna::RegularExpression::match ( const std::string &  value)
inline

Same as isLike

75 { return isLike(value); }
bool isLike(const std::string &value)
Here is the call graph for this function:

◆ operator<()

bool anna::RegularExpression::operator< ( const RegularExpression re) const

Operator <

Parameters
reInstance from RegularExpression class
Returns
Returns re < this comparison based on private 'pattern' member

◆ operator==()

bool anna::RegularExpression::operator== ( const RegularExpression re) const

Operator ==

Parameters
reInstance from RegularExpression class
Returns
Returns re == this comparison based on private 'pattern' member

◆ setPattern()

void anna::RegularExpression::setPattern ( const std::string &  pattern)

Set the pattern for regular expression

Parameters
patternPattern

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