blob: b12e8f9accc12baec7e94cbccf76ceb4ee6a2807 [file] [log] [blame]
akmhoque157b0a42014-05-13 00:26:37 -05001#ifndef CONF_PROCESSOR_HPP
2#define CONF_PROCESSOR_HPP
akmhoque53353462014-04-22 08:43:45 -05003
akmhoque157b0a42014-05-13 00:26:37 -05004#include <boost/smart_ptr/shared_ptr.hpp>
5#include <boost/property_tree/ptree.hpp>
akmhoquefdbddb12014-05-02 18:35:19 -05006#include <boost/cstdint.hpp>
akmhoque157b0a42014-05-13 00:26:37 -05007
akmhoque53353462014-04-22 08:43:45 -05008#include "nlsr.hpp"
9
10namespace nlsr {
akmhoqueb6450b12014-04-24 00:01:03 -050011
akmhoque53353462014-04-22 08:43:45 -050012class ConfFileProcessor
13{
14public:
akmhoquefdbddb12014-05-02 18:35:19 -050015 ConfFileProcessor(Nlsr& nlsr, const std::string& cfile)
akmhoqueb6450b12014-04-24 00:01:03 -050016 : m_confFileName(cfile)
17 , m_nlsr(nlsr)
akmhoque53353462014-04-22 08:43:45 -050018 {
19 }
20
akmhoque157b0a42014-05-13 00:26:37 -050021 bool
22 processConfFile();
akmhoque53353462014-04-22 08:43:45 -050023
24private:
akmhoque157b0a42014-05-13 00:26:37 -050025 bool
26 load(std::istream& input);
akmhoque53353462014-04-22 08:43:45 -050027
akmhoque157b0a42014-05-13 00:26:37 -050028 bool
29 processSection(const std::string& section,
30 boost::property_tree::ptree SectionAttributeTree);
akmhoque53353462014-04-22 08:43:45 -050031
akmhoque157b0a42014-05-13 00:26:37 -050032 bool
33 processConfSectionGeneral(boost::property_tree::ptree SectionAttributeTree);
akmhoque53353462014-04-22 08:43:45 -050034
akmhoque157b0a42014-05-13 00:26:37 -050035 bool
36 processConfSectionNeighbors(boost::property_tree::ptree SectionAttributeTree);
akmhoque53353462014-04-22 08:43:45 -050037
akmhoque157b0a42014-05-13 00:26:37 -050038 bool
39 processConfSectionHyperbolic(boost::property_tree::ptree SectionAttributeTree);
akmhoque53353462014-04-22 08:43:45 -050040
akmhoque157b0a42014-05-13 00:26:37 -050041 bool
42 processConfSectionFib(boost::property_tree::ptree SectionAttributeTree);
akmhoque53353462014-04-22 08:43:45 -050043
akmhoque157b0a42014-05-13 00:26:37 -050044 bool
45 processConfSectionAdvertising(boost::property_tree::ptree SectionAttributeTree);
akmhoque53353462014-04-22 08:43:45 -050046
47private:
akmhoquefdbddb12014-05-02 18:35:19 -050048 std::string m_confFileName;
akmhoqueb6450b12014-04-24 00:01:03 -050049 Nlsr& m_nlsr;
akmhoque53353462014-04-22 08:43:45 -050050};
51
52} //namespace nlsr
akmhoque157b0a42014-05-13 00:26:37 -050053#endif //CONF_PROCESSOR_HPP