diff options
author | Roland Reichwein <mail@reichwein.it> | 2022-12-31 22:00:11 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2022-12-31 22:00:11 +0100 |
commit | 9465fd744cc2117190bafc1a3e2da9f10ca29bf9 (patch) | |
tree | 7d94bdaaa37cabb58cede695b03082b8360167bd /config.cpp | |
parent | af1c4ee4d74ff7afc997372802d851d11daad418 (diff) |
Storage via SQLite, Added tests (WIP)
Diffstat (limited to 'config.cpp')
-rw-r--r-- | config.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -9,9 +9,10 @@ namespace pt = boost::property_tree; namespace { const std::string default_datapath {"/var/lib/whiteboard"}; + const uint64_t default_maxage{0}; // timeout in seconds; 0 = no timeout } -Config::Config(const std::string& config_filename): m_dataPath{default_datapath} +Config::Config(const std::string& config_filename): m_dataPath{default_datapath}, m_maxage{default_maxage} { try { @@ -20,6 +21,7 @@ Config::Config(const std::string& config_filename): m_dataPath{default_datapath} pt::read_xml(config_filename, tree, pt::xml_parser::no_comments | pt::xml_parser::trim_whitespace); m_dataPath = tree.get<std::string>("config.datapath", default_datapath); + m_maxage = tree.get<uint64_t>("config.maxage", default_maxage); } catch (const std::exception& ex) { std::cerr << "Error reading config file " << config_filename << ". Using " << default_datapath << "." << std::endl; } @@ -29,3 +31,8 @@ std::string Config::getDataPath() const { return m_dataPath; } + +uint64_t Config::getMaxage() const +{ + return m_maxage; +} |