smartmontools SVN Rev 5645
Utility to control and monitor storage systems with "S.M.A.R.T."
|
Wrapper class for POSIX regex(3) or std::regex Supports copy & assignment and is compatible with STL containers. More...
#include <utility.h>
Public Types | |
typedef regmatch_t | match_range |
Public Member Functions | |
regular_expression () | |
~regular_expression () | |
regular_expression (const regular_expression &x) | |
regular_expression & | operator= (const regular_expression &x) |
regular_expression (const char *pattern) | |
Construct with pattern, throw on error. | |
bool | compile (const char *pattern) |
Set and compile new pattern, return false on error. | |
const char * | get_pattern () const |
const char * | get_errmsg () const |
Get error message from last compile(). | |
bool | empty () const |
bool | full_match (const char *str) const |
Return true if full string matches pattern. | |
bool | execute (const char *str, unsigned nmatch, match_range *pmatch) const |
Return true if substring matches pattern, fill match_range array. | |
Private Member Functions | |
void | free_buf () |
void | copy_buf (const regular_expression &x) |
bool | compile () |
Private Attributes | |
std::string | m_pattern |
std::string | m_errmsg |
regex_t | m_regex_buf |
Wrapper class for POSIX regex(3) or std::regex Supports copy & assignment and is compatible with STL containers.
typedef regmatch_t regular_expression::match_range |
regular_expression::regular_expression | ( | ) |
Definition at line 490 of file utility.cpp.
regular_expression::~regular_expression | ( | ) |
Definition at line 495 of file utility.cpp.
regular_expression::regular_expression | ( | const regular_expression & | x | ) |
Definition at line 500 of file utility.cpp.
|
explicit |
Construct with pattern, throw on error.
Definition at line 538 of file utility.cpp.
|
private |
Definition at line 556 of file utility.cpp.
bool regular_expression::compile | ( | const char * | pattern | ) |
Set and compile new pattern, return false on error.
Definition at line 547 of file utility.cpp.
|
private |
Definition at line 525 of file utility.cpp.
bool regular_expression::execute | ( | const char * | str, |
unsigned | nmatch, | ||
match_range * | pmatch | ||
) | const |
Return true if substring matches pattern, fill match_range array.
Definition at line 604 of file utility.cpp.
|
private |
Definition at line 517 of file utility.cpp.
bool regular_expression::full_match | ( | const char * | str | ) | const |
Return true if full string matches pattern.
Definition at line 593 of file utility.cpp.
|
inline |
|
inline |
regular_expression & regular_expression::operator= | ( | const regular_expression & | x | ) |
Definition at line 508 of file utility.cpp.