NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
regex-top-matcher.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2021 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*
21
* @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
22
*/
23
24
#ifndef NDN_CXX_UTIL_REGEX_REGEX_TOP_MATCHER_HPP
25
#define NDN_CXX_UTIL_REGEX_REGEX_TOP_MATCHER_HPP
26
27
#include "
ndn-cxx/util/regex/regex-matcher.hpp
"
28
29
namespace
ndn
{
30
31
class
RegexPatternListMatcher;
32
class
RegexBackrefManager;
33
34
class
RegexTopMatcher
:
public
RegexMatcher
35
{
36
public
:
37
explicit
38
RegexTopMatcher
(
const
std::string& expr,
const
std::string&
expand
=
""
);
39
40
bool
41
match
(
const
Name
&
name
);
42
43
bool
44
match
(
const
Name
& name,
size_t
offset,
size_t
len)
override
;
45
46
virtual
Name
47
expand
(
const
std::string&
expand
=
""
);
48
49
static
shared_ptr<RegexTopMatcher>
50
fromName
(
const
Name
& name,
bool
hasAnchor =
false
);
51
52
private
:
53
void
54
compile();
55
56
static
std::string
57
getItemFromExpand(
const
std::string& expand,
size_t
& offset);
58
59
static
std::string
60
convertSpecialChar(
const
std::string& str);
61
62
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
63
const
std::string m_expand;
64
shared_ptr<RegexPatternListMatcher> m_primaryMatcher;
65
shared_ptr<RegexPatternListMatcher> m_secondaryMatcher;
66
shared_ptr<RegexBackrefManager> m_primaryBackrefManager;
67
shared_ptr<RegexBackrefManager> m_secondaryBackrefManager;
68
bool
m_isSecondaryUsed;
69
};
70
71
}
// namespace ndn
72
73
#endif // NDN_CXX_UTIL_REGEX_REGEX_TOP_MATCHER_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::RegexTopMatcher::fromName
static shared_ptr< RegexTopMatcher > fromName(const Name &name, bool hasAnchor=false)
Definition:
regex-top-matcher.cpp:171
ndn::RegexTopMatcher
Definition:
regex-top-matcher.hpp:34
regex-matcher.hpp
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:48
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::RegexTopMatcher::expand
virtual Name expand(const std::string &expand="")
Definition:
regex-top-matcher.cpp:92
ndn::RegexTopMatcher::match
bool match(const Name &name)
Definition:
regex-top-matcher.cpp:65
ndn::RegexTopMatcher::RegexTopMatcher
RegexTopMatcher(const std::string &expr, const std::string &expand="")
Definition:
regex-top-matcher.cpp:33
ndn::name
Definition:
name-component-types.hpp:33
ndn::RegexMatcher
Definition:
regex-matcher.hpp:32
ndnSIM
ndn-cxx
ndn-cxx
util
regex
regex-top-matcher.hpp
Generated on Fri May 6 2022 12:34:13 for ndnSIM by
1.8.13