ndn::RegexComponentMatcher Class Reference

#include <ndn-cxx/util/regex/regex-component-matcher.hpp>

+ Inheritance diagram for ndn::RegexComponentMatcher:
+ Collaboration diagram for ndn::RegexComponentMatcher:

Public Types

enum  RegexExprType {
  EXPR_TOP,
  EXPR_PATTERN_LIST,
  EXPR_REPEAT_PATTERN,
  EXPR_BACKREF,
  EXPR_COMPONENT_SET,
  EXPR_COMPONENT,
  EXPR_PSEUDO
}
 

Public Member Functions

 RegexComponentMatcher (const std::string &expr, shared_ptr< RegexBackrefManager > backrefManager, bool isExactMatch=true)
 Create a RegexComponent matcher from expr. More...
 
const std::string & getExpr () const
 
const std::vector< name::Component > & getMatchResult () const
 get the matched name components More...
 
bool match (const Name &name, size_t offset, size_t len=1) override
 

Protected Member Functions

void compile () override
 Compile the regular expression to generate the more matchers when necessary. More...
 

Protected Attributes

shared_ptr< RegexBackrefManagerm_backrefManager
 
const std::string m_expr
 
std::vector< shared_ptr< RegexMatcher > > m_matchers
 
std::vector< name::Componentm_matchResult
 
const RegexExprType m_type
 

Detailed Description

Definition at line 35 of file regex-component-matcher.hpp.

Member Enumeration Documentation

◆ RegexExprType

Enumerator
EXPR_TOP 
EXPR_PATTERN_LIST 
EXPR_REPEAT_PATTERN 
EXPR_BACKREF 
EXPR_COMPONENT_SET 
EXPR_COMPONENT 
EXPR_PSEUDO 

Definition at line 41 of file regex-matcher.hpp.

Constructor & Destructor Documentation

◆ RegexComponentMatcher()

ndn::RegexComponentMatcher::RegexComponentMatcher ( const std::string &  expr,
shared_ptr< RegexBackrefManager backrefManager,
bool  isExactMatch = true 
)

Create a RegexComponent matcher from expr.

Parameters
exprThe standard regular expression to match a component
backrefManagerThe back reference manager
isExactMatchThe flag to provide exact match

Definition at line 29 of file regex-component-matcher.cpp.

Member Function Documentation

◆ compile()

void ndn::RegexComponentMatcher::compile ( )
overrideprotectedvirtual

Compile the regular expression to generate the more matchers when necessary.

Implements ndn::RegexMatcher.

Definition at line 39 of file regex-component-matcher.cpp.

◆ getExpr()

const std::string& ndn::RegexMatcher::getExpr ( ) const
inlineinherited

Definition at line 71 of file regex-matcher.hpp.

◆ getMatchResult()

const std::vector<name::Component>& ndn::RegexMatcher::getMatchResult ( ) const
inlineinherited

get the matched name components

Returns
the matched name components

Definition at line 65 of file regex-matcher.hpp.

◆ match()

bool ndn::RegexComponentMatcher::match ( const Name name,
size_t  offset,
size_t  len = 1 
)
overridevirtual

Reimplemented from ndn::RegexMatcher.

Definition at line 53 of file regex-component-matcher.cpp.

Member Data Documentation

◆ m_backrefManager

shared_ptr<RegexBackrefManager> ndn::RegexMatcher::m_backrefManager
protectedinherited

Definition at line 90 of file regex-matcher.hpp.

◆ m_expr

const std::string ndn::RegexMatcher::m_expr
protectedinherited

Definition at line 88 of file regex-matcher.hpp.

◆ m_matchers

std::vector<shared_ptr<RegexMatcher> > ndn::RegexMatcher::m_matchers
protectedinherited

Definition at line 91 of file regex-matcher.hpp.

◆ m_matchResult

std::vector<name::Component> ndn::RegexMatcher::m_matchResult
protectedinherited

Definition at line 92 of file regex-matcher.hpp.

◆ m_type

const RegexExprType ndn::RegexMatcher::m_type
protectedinherited

Definition at line 89 of file regex-matcher.hpp.