blob: 0aeea5725ff2c04f77ca83cca433891f47a5f97c [file] [log] [blame]
Yingdi Yu5e974202014-01-29 16:59:06 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * See COPYING for copyright and distribution information.
6 */
7
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -08008#ifndef NDN_UTIL_REGEX_REGEX_PSEUDO_MATCHER_HPP
9#define NDN_UTIL_REGEX_REGEX_PSEUDO_MATCHER_HPP
Yingdi Yu5e974202014-01-29 16:59:06 -080010
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -080011#include "../../common.hpp"
Yingdi Yu5e974202014-01-29 16:59:06 -080012#include "regex-matcher.hpp"
13
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -080014namespace ndn {
15
Yingdi Yu5e974202014-01-29 16:59:06 -080016class RegexPseudoMatcher : public RegexMatcher
17{
18public:
19 RegexPseudoMatcher();
20
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -080021 virtual ~RegexPseudoMatcher()
22 {
23 }
Yingdi Yu5e974202014-01-29 16:59:06 -080024
25 virtual void
26 compile()
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -080027 {
28 }
Yingdi Yu5e974202014-01-29 16:59:06 -080029
30 void
31 setMatchResult(const std::string& str);
32
33 void
34 resetMatchResult();
35};
36
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -080037inline RegexPseudoMatcher::RegexPseudoMatcher()
38 :RegexMatcher ("", EXPR_PSEUDO)
39{
40}
Yingdi Yu5e974202014-01-29 16:59:06 -080041
Alexander Afanasyev36b84cf2014-02-17 19:34:18 -080042inline void
43RegexPseudoMatcher::setMatchResult(const std::string& str)
44{
45 m_matchResult.push_back(Name::Component((const uint8_t *)str.c_str(), str.size()));
46}
47
48inline void
49RegexPseudoMatcher::resetMatchResult()
50{
51 m_matchResult.clear();
52}
53
54
55} // namespace ndn
56
57#endif // NDN_UTIL_REGEX_REGEX_PSEUDO_MATCHER_HPP