conf-file-processor.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
21 #ifndef NLSR_CONF_FILE_PROCESSOR_HPP
22 #define NLSR_CONF_FILE_PROCESSOR_HPP
23 
24 #include "common.hpp"
25 #include "nlsr.hpp"
26 
27 #include <boost/algorithm/string.hpp>
28 #include <boost/property_tree/info_parser.hpp>
29 #include <boost/filesystem.hpp>
30 
31 namespace nlsr {
32 
47 {
48 public:
49  ConfFileProcessor(Nlsr& nlsr, const std::string& cfile)
50  : m_confFileName(cfile)
51  , m_nlsr(nlsr)
52  {
53  }
54 
62  bool
64 
65 private:
66  typedef boost::property_tree::ptree ConfigSection;
67 
78  bool
79  load(std::istream& input);
80 
83  bool
84  processSection(const std::string& sectionName, const ConfigSection& section);
85 
88  bool
89  processConfSectionGeneral(const ConfigSection& section);
90 
98  bool
99  processConfSectionNeighbors(const ConfigSection& section);
100 
103  bool
104  processConfSectionHyperbolic(const ConfigSection& section);
105 
108  bool
109  processConfSectionFib(const ConfigSection& section);
110 
113  bool
114  processConfSectionAdvertising(const ConfigSection& section);
115 
122  bool
123  processConfSectionSecurity(const ConfigSection& section);
124 
125 private:
127  std::string m_confFileName;
129  Nlsr& m_nlsr;
130 };
131 
132 } // namespace nlsr
133 #endif // NLSR_CONF_FILE_PROCESSOR_HPP
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California.
A class containing methods to parse an NLSR configuration file.
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
bool processConfFile()
Load and parse the configuration file, then populate NLSR.
ConfFileProcessor(Nlsr &nlsr, const std::string &cfile)