15#include "CoreObject.h"
17#include "Concurrency.h"
22namespace fs = ::std::filesystem;
24class Defaults final :
public CoreObject {
26 mutable util::ReentrantMutex mutex;
29 std::map <string, string> values;
32 std::map <string, string> fallbacks;
42 Defaults(Defaults
const&) =
delete;
43 const char *objectName()
const override {
return "Defaults"; }
44 void operator=(Defaults
const&) =
delete;
48 void _dump(Category category, std::ostream& os)
const override;
58 void load(
const fs::path &path);
59 void load(std::ifstream &stream);
60 void load(std::stringstream &stream);
63 void save(
const fs::path &path);
64 void save(std::ofstream &stream);
65 void save(std::stringstream &stream);
75 string getString(
const string &key)
const;
76 i64 getInt(
const string &key)
const;
78 i64 get(Option option, isize nr = 0)
const;
81 string getFallbackRaw(
const string &key)
const;
82 i64 getFallback(
const string &key)
const;
83 i64 getFallback(Option option)
const;
84 i64 getFallback(Option option, isize nr = 0)
const;
92 void set(
const string &key,
const string &value);
93 void set(Option option,
const string &value, std::vector<isize> objids = { 0 });
94 void set(Option option, i64 value, std::vector<isize> objids = { 0 });
97 void setFallback(
const string &key,
const string &value);
98 void setFallback(Option option,
const string &value, std::vector<isize> objids = { 0 });
99 void setFallback(Option option, i64 value, std::vector<isize> objids = { 0 });
110 void remove(
const string &key)
throws;
111 void remove(Option option, isize nr = 0) throws;
112 void remove(Option option, std::vector <isize> nrs) throws;
VirtualC64 project namespace.
Definition CmdQueue.cpp:16