Obaid | 5748c0c | 2014-04-09 18:00:42 -0500 | [diff] [blame] | 1 | #ifndef NRD_CONFIG_HPP |
| 2 | #define NRD_CONFIG_HPP |
| 3 | |
| 4 | #include "common.hpp" |
| 5 | |
| 6 | namespace ndn { |
| 7 | namespace nrd { |
| 8 | |
| 9 | typedef boost::property_tree::ptree ConfigSection; |
| 10 | |
| 11 | class NrdConfig |
| 12 | { |
| 13 | |
| 14 | public: |
| 15 | NrdConfig(); |
| 16 | |
| 17 | virtual |
| 18 | ~NrdConfig() |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | void |
| 23 | load(const std::string& filename); |
| 24 | |
| 25 | void |
| 26 | load(const std::string& input, const std::string& filename); |
| 27 | |
| 28 | void |
| 29 | load(std::istream& input, const std::string& filename); |
| 30 | |
| 31 | const ConfigSection& |
| 32 | getSecuritySection() const |
| 33 | { |
| 34 | return m_securitySection; |
| 35 | } |
| 36 | |
| 37 | private: |
| 38 | void |
| 39 | process(const ConfigSection& configSection, |
| 40 | const std::string& filename); |
| 41 | |
| 42 | void |
| 43 | onSectionSecurity(const ConfigSection& section, |
| 44 | const std::string& filename); |
| 45 | |
| 46 | const void |
| 47 | setSecturitySection(const ConfigSection& securitySection) |
| 48 | { |
| 49 | m_securitySection = securitySection; |
| 50 | } |
| 51 | |
| 52 | private: |
| 53 | bool m_isSecuritySectionDefined; |
| 54 | ConfigSection m_securitySection; |
| 55 | std::string m_filename; |
| 56 | }; |
| 57 | |
| 58 | }//namespace nrd |
| 59 | }//namespace ndn |
| 60 | |
| 61 | #endif // NRD_CONFIG_HPP |