Aktualizr
C++ SOTA Client
aktualizr_info_config.h
1 #ifndef AKTUALIZR_INFO_CONFIG_H_
2 #define AKTUALIZR_INFO_CONFIG_H_
3 
4 #include <boost/filesystem.hpp>
5 #include <boost/program_options.hpp>
6 #include <boost/property_tree/ini_parser.hpp>
7 
8 #include "libaktualizr/config.h"
9 #include "utilities/config_utils.h"
10 
11 // Try to keep the order of config options the same as in
12 // AktualizrInfoConfig::writeToStream() and
13 // AktualizrInfoConfig::updateFromPropertyTree().
14 
16  public:
17  AktualizrInfoConfig() = default;
18  AktualizrInfoConfig(const boost::program_options::variables_map& cmd);
19  explicit AktualizrInfoConfig(const boost::filesystem::path& filename);
20 
21  void postUpdateValues();
22  void writeToStream(std::ostream& sink) const;
23 
24  // from Primary config
25  BootloaderConfig bootloader;
26  LoggerConfig logger;
27  PackageConfig pacman;
28  StorageConfig storage;
29 
30  private:
31  void updateFromCommandLine(const boost::program_options::variables_map& cmd);
32  void updateFromPropertyTree(const boost::property_tree::ptree& pt) override;
33 
34  bool loglevel_from_cmdline{false};
35 };
36 std::ostream& operator<<(std::ostream& os, const AktualizrInfoConfig& cfg);
37 
38 #endif // AKTUALIZR_INFO_CONFIG_H_
BaseConfig
The BaseConfig class.
Definition: config.h:181
StorageConfig
Definition: config.h:111
AktualizrInfoConfig
Definition: aktualizr_info_config.h:15
LoggerConfig
Definition: config.h:18
PackageConfig
Definition: config.h:91
BootloaderConfig
Definition: config.h:156