Puma Reference Manual | Puma::RegComp Class Reference |
Instances of this class encapsulate a regular expression and the match mechanism. More...
#include <Puma/RegComp.h>
Public Member Functions | |
RegComp (const std::string &expr) | |
RegComp (const RegComp &rc) | |
RegComp & | operator= (const RegComp &rc) |
bool | compile (const string &expr) |
Compile the regular expression. | |
bool | match (const std::string &str) |
Match against a string. | |
void | comperror (ErrorStream &err) const |
To be called on errors. | |
bool | error () const |
Check whether there was an error. |
Instances of this class encapsulate a regular expression and the match mechanism.
The implementation compiles the expression when a string is matched for the first time. In case of an error, a message can be printed on an ErrorStream object.
Puma::RegComp::RegComp | ( | const std::string & | expr | ) |
Puma::RegComp::RegComp | ( | const RegComp & | rc | ) |
void Puma::RegComp::comperror | ( | ErrorStream & | err | ) | const |
To be called on errors.
err | ErrorStream on which the error message should be printed. |
bool Puma::RegComp::compile | ( | const string & | expr | ) |
Compile the regular expression.
expr | The regular expression string, which should be compiled |
bool Puma::RegComp::error | ( | ) | const [inline] |
Check whether there was an error.
bool Puma::RegComp::match | ( | const std::string & | str | ) |
Match against a string.
str | String to be matched. |