ConfigFile.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Utils_Console_ConfigFile_
18 #define HH_SENF_Utils_Console_ConfigFile_ 1
19 
20 // Custom includes
21 #include "Config.hh"
22 
23 //#include "ConfigFile.mpp"
24 #include "ConfigFile.ih"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 namespace console {
29 
51  class ConfigFile
52  : public detail::BundleMixin
53  {
54  public:
55  //-////////////////////////////////////////////////////////////////////////
57  //\{
58 
59  explicit ConfigFile(std::string const & filename, DirectoryNode & root = senf::console::root());
61 
65  //\}
66  //-////////////////////////////////////////////////////////////////////////
67 
68  void ignoreMissing();
69 
70  private:
71  detail::ConfigFileSource & self_;
72  };
73 
83  void parseFile(std::string const & filename, DirectoryNode & root = senf::console::root());
84 
92  detail::ConfigFileSource::ptr FileConfig(std::string const & filename);
93 
94 }}
95 
96 //-/////////////////////////////////////////////////////////////////////////////////////////////////
97 #include "ConfigFile.cci"
98 //#include "ConfigFile.ct"
99 //#include "ConfigFile.cti"
100 #endif
101 
102 
103 // Local Variables:
104 // mode: c++
105 // fill-column: 100
106 // comment-column: 40
107 // c-file-style: "senf"
108 // indent-tabs-mode: nil
109 // ispell-local-dictionary: "american"
110 // compile-command: "scons -u test"
111 // End:
Config public header.
void ignoreMissing()
Call to ignore missing files.
Config/console tree directory node.
Definition: Node.hh:406
Definition: Config.hh:28
void parseFile(std::string const &filename, DirectoryNode &root=senf::console::root())
Read configuration file.
Console node tree based config file parser.
Definition: ConfigFile.hh:51
DirectoryNode & root()
Get console root node.
Definition: Node.cc:26
ConfigFile(std::string const &filename, DirectoryNode &root=senf::console::root())
Create ConfigFile object for filename.
Internal: Provide ConfigBundle facade for a single-source config.
Definition: Config.hh:105
detail::ConfigFileSource::ptr FileConfig(std::string const &filename)
ConfigBundle source reading a configuration file.