All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
ndn-regex-component-matcher.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_NDN_REGEX_COMPONENT_MATCHER_HPP
24 #define NDN_NDN_REGEX_COMPONENT_MATCHER_HPP
25 
26 #include "ndn-regex-pseudo-matcher.hpp"
27 #include "ndn-regex-matcher-base.hpp"
28 
29 namespace ndn {
30 
31 class NdnRegexComponentMatcher : public NdnRegexMatcherBase {
32 public:
40  (const std::string& expr,
41  ptr_lib::shared_ptr<NdnRegexBackrefManager> backrefManager,
42  bool isExactMatch = true)
43  : NdnRegexMatcherBase(expr, NDN_REGEX_EXPR_COMPONENT, backrefManager),
44  isExactMatch_(isExactMatch)
45  {
46  compile();
47  }
48 
49  virtual
51 
52  virtual bool
53  match(const Name& name, size_t offset, size_t len);
54 
55 protected:
59  virtual void
60  compile();
61 
62 private:
63  bool isExactMatch_;
64  regex_lib::regex componentRegex_;
65  std::vector<ptr_lib::shared_ptr<NdnRegexPseudoMatcher> > pseudoMatchers_;
66 };
67 
68 
69 }
70 
71 #endif
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
virtual void compile()
Compile the regular expression to generate more matchers when necessary.
NdnRegexComponentMatcher(const std::string &expr, ptr_lib::shared_ptr< NdnRegexBackrefManager > backrefManager, bool isExactMatch=true)
Create a RegexComponent matcher from expr.
Definition: ndn-regex-component-matcher.hpp:40
Definition: ndn-regex-component-matcher.hpp:31