|
ui-utilcpp
1.8.3
|
Wrapper class for POSIX.2 regex functions. More...
#include <PosixRegex.hpp>

Data Structures | |
| class | Match |
| Helper class representing match data. More... | |
Public Types | |
| typedef CodeException< reg_errcode_t > | Exception |
| Exceptions we might throw. | |
Public Member Functions | |
| PosixRegex (std::string const ®ex, int cflags=0) throw (Exception) | |
| Match | runMatch (std::string const &text, int eflags=0) throw (Exception) |
| Check if text matches, and return the (first) match. More... | |
| bool | run (std::string const &text, int eflags=0) throw (Exception) |
| Check if text matches. More... | |
Wrapper class for POSIX.2 regex functions.
Not fully encapsulated; flags must be given using the values from regex.h; Catched exception code must be compared against the reg_errcode_t defined in regex.h.
Does not support multiple matches (seems this does not work anyway currently)
Does not support clear text error reporting as via regerror.
| UI::Util::PosixRegex::PosixRegex | ( | std::string const & | regex, |
| int | cflags = 0 |
||
| ) | |||
| throw | ( | Exception | |
| ) | |||
| regex | The regular expression |
| cflags | Flags as described in regex(3) |
References UI_THROW_CODE.
| bool UI::Util::PosixRegex::run | ( | std::string const & | text, |
| int | eflags = 0 |
||
| ) | |||
| throw | ( | Exception | |
| ) | |||
Check if text matches.
| text | Text to examine. |
| eflags | Flags as described in regex(3). |
| PosixRegex::Match UI::Util::PosixRegex::runMatch | ( | std::string const & | text, |
| int | eflags = 0 |
||
| ) | |||
| throw | ( | Exception | |
| ) | |||
Check if text matches, and return the (first) match.
| text | Text to examine. |
| eflags | Flags as described in regex(3). |
References UI::Util::PosixRegex::Match::begin, UI::Util::PosixRegex::Match::end, UI::Util::PosixRegex::Match::matches, and UI_THROW_CODE.
1.8.9.1