blob: 882fbab74262a0b16f83c8e44c3157e0c7363c56 [file] [log] [blame]
Yingdi Yu92672512015-03-24 13:59:33 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014, Regents of the University of California
4 *
5 * This file is part of NSL (NDN Signature Logger).
6 * See AUTHORS.md for complete list of NSL authors and contributors.
7 *
8 * NSL is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * NSL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * NSL, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of nsl authors and contributors.
20 */
21
22#ifndef NSL_CONF_CONFIG_FILE_HPP
23#define NSL_CONF_CONFIG_FILE_HPP
24
25#include "common.hpp"
26#include "config.hpp"
27
28namespace nsl {
29namespace conf {
30class ConfigFile
31{
32public:
33 ConfigFile(const std::string& filename);
34
35 void
36 parse();
37
38 const std::string&
39 getConfFileName() const
40 {
41 return m_filename;
42 }
43
44 const Name&
45 getLoggerName() const
46 {
47 return m_loggerName;
48 }
49
50 const std::string&
51 getDbDir() const
52 {
53 return m_dbDir;
54 }
55
56 const ConfigSection&
57 getPolicy() const
58 {
59 return m_policy;
60 }
61
62 const ConfigSection&
63 getValidatorRule() const
64 {
65 return m_validatorRule;
66 }
67
68private:
69 std::string m_filename;
70 Name m_loggerName;
71 std::string m_dbDir;
72 ConfigSection m_policy;
73 ConfigSection m_validatorRule;
74};
75
76} // namespace conf
77} // namespace nsl
78
79#endif // NSL_CONF_CONFIG_FILE_HPP