2 Copyright 2021 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
25 #include <jsoncpp/json/json.h>
32 static Config* getInstance();
36 bool getString(const std::string& section, const std::string& key, std::string& out) const;
37 bool getInt(const std::string& section, const std::string& key, int& out) const;
38 bool getBool(const std::string& section, const std::string& key, bool& out) const;
40 bool foreachInArray(const std::string& section, const std::string& key, std::function<void(const std::string&)> callback) const;
41 bool foreachPairInObject(const std::string& section, const std::string& key, std::function<void(const std::string&, const std::string&)> callback) const;
43 void set(const std::string& section, const std::string& key, const std::string& value);
44 void set(const std::string& section, const std::string& key, bool value);
45 void set(const std::string& section, const std::string& key, const char* value);
46 void set(const std::string& section, const std::string& key, int value);
49 static Config* instance;
54 const Json::Value& jconfigro;