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