regex: modernize and simplify code
Change-Id: Ia4a3046d409ab1e5d8507da4d369dfee203f6256
diff --git a/src/util/regex/regex-pseudo-matcher.hpp b/src/util/regex/regex-pseudo-matcher.hpp
index 990840a..a2c19a0 100644
--- a/src/util/regex/regex-pseudo-matcher.hpp
+++ b/src/util/regex/regex-pseudo-matcher.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2014 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,7 +24,6 @@
#ifndef NDN_UTIL_REGEX_REGEX_PSEUDO_MATCHER_HPP
#define NDN_UTIL_REGEX_REGEX_PSEUDO_MATCHER_HPP
-#include "../../common.hpp"
#include "regex-matcher.hpp"
namespace ndn {
@@ -34,21 +33,15 @@
public:
RegexPseudoMatcher();
- virtual
- ~RegexPseudoMatcher()
- {
- }
-
- virtual void
- compile()
- {
- }
-
void
setMatchResult(const std::string& str);
void
resetMatchResult();
+
+protected:
+ void
+ compile() override;
};
inline
@@ -60,8 +53,7 @@
inline void
RegexPseudoMatcher::setMatchResult(const std::string& str)
{
- m_matchResult.push_back(name::Component(reinterpret_cast<const uint8_t*>(str.c_str()),
- str.size()));
+ m_matchResult.push_back(name::Component(reinterpret_cast<const uint8_t*>(str.data()), str.size()));
}
inline void
@@ -70,6 +62,10 @@
m_matchResult.clear();
}
+inline void
+RegexPseudoMatcher::compile()
+{
+}
} // namespace ndn