ConfigFile.cci
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 
14 /** \file
15  \brief ConfigFile inline non-template implementation */
16 
17 #include "ConfigFile.ih"
18 
19 // Custom includes
20 
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::console::detail::ConfigFileSource
26 #ifndef DOXYGEN
27 
28 prefix_ senf::console::detail::ConfigFileSource::ptr
29 senf::console::detail::ConfigFileSource::create(std::string const & filename)
30 {
31  return ptr(new ConfigFileSource(filename));
32 }
33 
34 prefix_ senf::console::detail::ConfigFileSource::ptr
35 senf::console::detail::ConfigFileSource::ignoreMissing()
36 {
37  ignoreMissing_ = true;
38  return ptr(this);
39 }
40 
41 prefix_ senf::console::detail::ConfigFileSource::ConfigFileSource(std::string const & filename)
42  : filename_ (filename), ignoreMissing_ (false)
43 {}
44 #endif
45 
46 //-/////////////////////////////////////////////////////////////////////////////////////////////////
47 // senf::console::ConfigFile
48 
49 prefix_ senf::console::ConfigFile::ConfigFile(std::string const & filename,
50  DirectoryNode & root)
51  : detail::BundleMixin(root), self_ (add(detail::ConfigFileSource::create(filename)))
52 {}
53 
54 prefix_ void senf::console::ConfigFile::ignoreMissing()
55 {
56  self_.ignoreMissing();
57 }
58 
59 //-/////////////////////////////////////////////////////////////////////////////////////////////////
60 
61 prefix_ senf::console::detail::ConfigFileSource::ptr
62 senf::console::FileConfig(std::string const & filename)
63 {
64  return detail::ConfigFileSource::create(filename);
65 }
66 
67 //-/////////////////////////////////////////////////////////////////////////////////////////////////
68 #undef prefix_
69 
70 
71 // Local Variables:
72 // mode: c++
73 // fill-column: 100
74 // comment-column: 40
75 // c-file-style: "senf"
76 // indent-tabs-mode: nil
77 // ispell-local-dictionary: "american"
78 // compile-command: "scons -u test"
79 // End: