fix8
version 1.4.0
Open Source C++ FIX Framework
|
POSIX regex wrapper class. More...
#include <f8utils.hpp>
Public Member Functions | |
RegExp (const char *pattern, const int flags=0) | |
virtual | ~RegExp () |
Dtor. Destroys internal compiled expression. More... | |
int | SearchString (RegMatch &match, const std::string &source, const int subExpr, const int offset=0) const |
const std::string & | GetPattern () const |
const std::string & | ErrString () const |
bool | operator! () const |
operator void * () | |
Static Public Member Functions | |
static std::string & | SubExpr (RegMatch &match, const std::string &source, std::string &target, const int offset=0, const int num=0) |
static std::string & | Erase (RegMatch &match, std::string &source, const int num=0) |
static std::string & | Replace (RegMatch &match, std::string &source, const std::string &with, const int num=0) |
static std::string & | Replace (RegMatch &match, std::string &source, const char with, const int num=0) |
Private Types | |
enum | { MaxErrLen_ = 256 } |
Maximum length of an error message. More... | |
Private Attributes | |
const std::string | pattern_ |
regex_t | reg_ |
std::string | errString |
int | errCode_ |
POSIX regex wrapper class.
Definition at line 370 of file f8utils.hpp.
|
private |
Maximum length of an error message.
Enumerator | |
---|---|
MaxErrLen_ |
Definition at line 375 of file f8utils.hpp.
|
inline |
Ctor.
pattern | regular expression to compile. errCode and errString set on error. |
flags | POSIX regcomp flags |
Definition at line 388 of file f8utils.hpp.
References MaxErrLen_.
|
inlinevirtual |
|
inlinestatic |
Erase a sub-expression from a string.
match | reference to a RegMatch object |
source | source string |
num | desired sub-expression |
Definition at line 471 of file f8utils.hpp.
References FIX8::RegMatch::SubCnt(), FIX8::RegMatch::subCnt_, FIX8::RegMatch::subexprs_, FIX8::RegMatch::SubPos(), and FIX8::RegMatch::SubSize().
Referenced by main().
|
inline |
Get the error string (set when Ctor fails to compile).
Definition at line 525 of file f8utils.hpp.
References errString.
|
inline |
Get the regular expression pattern.
Definition at line 521 of file f8utils.hpp.
References pattern_.
|
inline |
|
inline |
Check if a pattern did not compile ok.
Definition at line 529 of file f8utils.hpp.
References errCode_.
|
inlinestatic |
Replace a sub-expression with a string.
match | reference to a RegMatch object |
source | source string |
with | replacement string |
num | desired sub-expression |
Definition at line 489 of file f8utils.hpp.
References FIX8::RegMatch::SubCnt(), FIX8::RegMatch::subCnt_, FIX8::RegMatch::subexprs_, FIX8::RegMatch::SubPos(), and FIX8::RegMatch::SubSize().
Referenced by XmlElement::InplaceXlate().
|
inlinestatic |
Replace a sub-expression with a character.
match | reference to a RegMatch object |
source | source string |
with | replacement character |
num | desired sub-expression |
Definition at line 507 of file f8utils.hpp.
References FIX8::RegMatch::SubCnt(), FIX8::RegMatch::subCnt_, FIX8::RegMatch::subexprs_, FIX8::RegMatch::SubPos(), and FIX8::RegMatch::SubSize().
|
inline |
Search a string.
match | reference to a RegMatch object |
source | string to search |
subExpr | number of sub-expression |
offset | to start searching |
Definition at line 431 of file f8utils.hpp.
References FIX8::RegMatch::subCnt_, FIX8::RegMatch::subexprs_, and FIX8::RegMatch::SubLimit_.
Referenced by XmlElement::InplaceXlate(), and main().
|
inlinestatic |
Extract a sub-expression.
match | reference to a RegMatch object |
source | source string |
target | location to place sub-experssion |
offset | to start searching |
num | desired sub-expression |
Definition at line 452 of file f8utils.hpp.
References FIX8::RegMatch::SubCnt(), FIX8::RegMatch::subCnt_, FIX8::RegMatch::subexprs_, FIX8::RegMatch::SubPos(), and FIX8::RegMatch::SubSize().
Referenced by XmlElement::InplaceXlate(), and main().
|
private |
Definition at line 382 of file f8utils.hpp.
Referenced by operator!().
|
private |
Definition at line 381 of file f8utils.hpp.
Referenced by ErrString().
|
private |
Definition at line 372 of file f8utils.hpp.
Referenced by GetPattern().
|
private |
Definition at line 377 of file f8utils.hpp.