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 "conf-parameter.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 
33 namespace bf = boost::filesystem;
34 using ConfigSection = boost::property_tree::ptree;
35 
50 {
51 public:
52  ConfFileProcessor(ConfParameter& confParam);
53 
61  bool
63 
64 private:
75  bool
76  load(std::istream& input);
77 
80  bool
81  processSection(const std::string& sectionName, const ConfigSection& section);
82 
85  bool
86  processConfSectionGeneral(const ConfigSection& section);
87 
95  bool
96  processConfSectionNeighbors(const ConfigSection& section);
97 
100  bool
101  processConfSectionHyperbolic(const ConfigSection& section);
102 
105  bool
106  processConfSectionFib(const ConfigSection& section);
107 
110  bool
111  processConfSectionAdvertising(const ConfigSection& section);
112 
119  bool
120  processConfSectionSecurity(const ConfigSection& section);
121 
122 private:
124  std::string m_confFileName;
126  ConfParameter& m_confParam;
128  boost::asio::io_service m_io;
129 };
130 
131 } // namespace nlsr
132 #endif // NLSR_CONF_FILE_PROCESSOR_HPP
A class to house all the configuration parameters for NLSR.
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
A class containing methods to parse an NLSR configuration file.
Copyright (c) 2014-2019, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
boost::property_tree::ptree ConfigSection
ConfFileProcessor(ConfParameter &confParam)
bool processConfFile()
Load and parse the configuration file, then populate NLSR.