nrd-config: Adding processing of command line arguments and processing of conf file.
refs #1450
Change-Id: I18fa5c1c12ec2367670659be331a9f95e0a920eb
diff --git a/src/nrd-config.hpp b/src/nrd-config.hpp
new file mode 100644
index 0000000..ee119f6
--- /dev/null
+++ b/src/nrd-config.hpp
@@ -0,0 +1,61 @@
+#ifndef NRD_CONFIG_HPP
+#define NRD_CONFIG_HPP
+
+#include "common.hpp"
+
+namespace ndn {
+namespace nrd {
+
+typedef boost::property_tree::ptree ConfigSection;
+
+class NrdConfig
+{
+
+public:
+ NrdConfig();
+
+ virtual
+ ~NrdConfig()
+ {
+ }
+
+ void
+ load(const std::string& filename);
+
+ void
+ load(const std::string& input, const std::string& filename);
+
+ void
+ load(std::istream& input, const std::string& filename);
+
+ const ConfigSection&
+ getSecuritySection() const
+ {
+ return m_securitySection;
+ }
+
+private:
+ void
+ process(const ConfigSection& configSection,
+ const std::string& filename);
+
+ void
+ onSectionSecurity(const ConfigSection& section,
+ const std::string& filename);
+
+ const void
+ setSecturitySection(const ConfigSection& securitySection)
+ {
+ m_securitySection = securitySection;
+ }
+
+private:
+ bool m_isSecuritySectionDefined;
+ ConfigSection m_securitySection;
+ std::string m_filename;
+};
+
+}//namespace nrd
+}//namespace ndn
+
+#endif // NRD_CONFIG_HPP