#include <regex-matcher.hpp>
Classes | |
class | Error |
Public Types | |
enum | RegexExprType { EXPR_TOP, EXPR_PATTERN_LIST, EXPR_REPEAT_PATTERN, EXPR_BACKREF, EXPR_COMPONENT_SET, EXPR_COMPONENT, EXPR_PSEUDO } |
Public Member Functions | |
RegexMatcher (const std::string &expr, const RegexExprType &type, shared_ptr< RegexBackrefManager > backrefManager=nullptr) | |
virtual | ~RegexMatcher () |
virtual bool | match (const Name &name, size_t offset, size_t len) |
const std::vector< name::Component > & | getMatchResult () const |
get the matched name components More... | |
const std::string & | getExpr () const |
Protected Member Functions | |
virtual void | compile ()=0 |
Compile the regular expression to generate the more matchers when necessary. More... | |
Protected Attributes | |
const std::string | m_expr |
const RegexExprType | m_type |
shared_ptr< RegexBackrefManager > | m_backrefManager |
std::vector< shared_ptr< RegexMatcher > > | m_matchers |
std::vector< name::Component > | m_matchResult |
Definition at line 32 of file regex-matcher.hpp.
Enumerator | |
---|---|
EXPR_TOP | |
EXPR_PATTERN_LIST | |
EXPR_REPEAT_PATTERN | |
EXPR_BACKREF | |
EXPR_COMPONENT_SET | |
EXPR_COMPONENT | |
EXPR_PSEUDO |
Definition at line 45 of file regex-matcher.hpp.
ndn::RegexMatcher::RegexMatcher | ( | const std::string & | expr, |
const RegexExprType & | type, | ||
shared_ptr< RegexBackrefManager > | backrefManager = nullptr |
||
) |
Definition at line 28 of file regex-matcher.cpp.
References m_backrefManager.
|
virtualdefault |
|
virtual |
Reimplemented in ndn::RegexComponentMatcher, ndn::RegexComponentSetMatcher, ndn::RegexTopMatcher, and ndn::RegexRepeatMatcher.
Definition at line 42 of file regex-matcher.cpp.
References m_matchResult.
|
inline |
get the matched name components
Definition at line 69 of file regex-matcher.hpp.
References m_matchResult.
|
inline |
Definition at line 75 of file regex-matcher.hpp.
References m_expr.
Referenced by ndn::operator<<().
|
protectedpure virtual |
Compile the regular expression to generate the more matchers when necessary.
Implemented in ndn::RegexTopMatcher, ndn::RegexComponentMatcher, ndn::RegexComponentSetMatcher, ndn::RegexBackrefMatcher, ndn::RegexPseudoMatcher, ndn::RegexRepeatMatcher, and ndn::RegexPatternListMatcher.
|
protected |
Definition at line 92 of file regex-matcher.hpp.
Referenced by ndn::RegexPatternListMatcher::compile(), ndn::RegexRepeatMatcher::compile(), ndn::RegexBackrefMatcher::compile(), ndn::RegexComponentMatcher::compile(), ndn::RegexComponentSetMatcher::compile(), ndn::RegexTopMatcher::compile(), getExpr(), and ndn::RegexComponentMatcher::match().
|
protected |
Definition at line 93 of file regex-matcher.hpp.
|
protected |
Definition at line 94 of file regex-matcher.hpp.
Referenced by ndn::RegexRepeatMatcher::compile(), ndn::RegexBackrefMatcher::compile(), ndn::RegexComponentMatcher::compile(), and RegexMatcher().
|
protected |
Definition at line 95 of file regex-matcher.hpp.
Referenced by ndn::RegexRepeatMatcher::compile(), and ndn::RegexBackrefMatcher::compile().
|
protected |
Definition at line 96 of file regex-matcher.hpp.
Referenced by ndn::RegexTopMatcher::expand(), getMatchResult(), ndn::RegexRepeatMatcher::match(), ndn::RegexTopMatcher::match(), ndn::RegexComponentSetMatcher::match(), ndn::RegexComponentMatcher::match(), match(), ndn::RegexPseudoMatcher::resetMatchResult(), and ndn::RegexPseudoMatcher::setMatchResult().