/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/**
 * Copyright (c) 2013-2014,  Regents of the University of California.
 * All rights reserved.
 *
 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
 *
 * This file licensed under New BSD License.  See COPYING for detailed information about
 * ndn-cxx library copyright, permissions, and redistribution restrictions.
 *
 * @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
 */

#ifndef NDN_UTIL_REGEX_REGEX_TOP_MATCHER_HPP
#define NDN_UTIL_REGEX_REGEX_TOP_MATCHER_HPP

#include "../../common.hpp"

#include "regex-matcher.hpp"

namespace ndn {

class RegexPatternListMatcher;
class RegexBackrefManager;

class RegexTopMatcher: public RegexMatcher
{
public:
  RegexTopMatcher(const std::string& expr, const std::string& expand = "");

  virtual
  ~RegexTopMatcher();

  bool
  match(const Name& name);

  virtual bool
  match(const Name& name, const int& offset, const int& length);

  virtual Name
  expand(const std::string& expand = "");

  static shared_ptr<RegexTopMatcher>
  fromName(const Name& name, bool hasAnchor=false);

protected:
  virtual void
  compile();

private:
  std::string
  getItemFromExpand(const std::string& expand, size_t& offset);

  static std::string
  convertSpecialChar(const std::string& str);

private:
  const std::string m_expand;
  shared_ptr<RegexPatternListMatcher> m_primaryMatcher;
  shared_ptr<RegexPatternListMatcher> m_secondaryMatcher;
  shared_ptr<RegexBackrefManager> m_primaryBackRefManager;
  shared_ptr<RegexBackrefManager> m_secondaryBackRefManager;
  bool m_secondaryUsed;
};

} // namespace ndn

#endif // NDN_UTIL_REGEX_REGEX_TOP_MATCHER_HPP
