Adds further ext deps as-is binaries copies from customers env.
Qt6 Migration CI / migrate (push) Canceled after 0s
Qt6 Migration CI / migrate (push) Canceled after 0s
This commit is contained in:
3700 files changed
+2132394
No files matched your search
+43
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ddkit {
|
||||
namespace base {
|
||||
|
||||
class IConfig {
|
||||
public:
|
||||
virtual ~IConfig() = default;
|
||||
|
||||
virtual bool hasKey(const std::string& key) const = 0;
|
||||
|
||||
// getters which throw if the key does not exist
|
||||
virtual std::string getStringValue(const std::string& key) const = 0;
|
||||
virtual int getIntValue(const std::string& key) const = 0;
|
||||
virtual int64_t getInt64Value(const std::string& key) const = 0;
|
||||
virtual bool getBoolValue(const std::string& key) const = 0;
|
||||
|
||||
// getters which return a default if the key does not exist
|
||||
std::string getStringValue(const std::string& key, const std::string& defaultValue) const {
|
||||
if (hasKey(key)) return getStringValue(key);
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
int getIntValue(const std::string& key, int defaultValue) const {
|
||||
if (hasKey(key)) return getIntValue(key);
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
int64_t getInt64Value(const std::string& key, int64_t defaultValue) const {
|
||||
if (hasKey(key)) return getInt64Value(key);
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
bool getBoolValue(const std::string& key, bool defaultValue) const {
|
||||
if (hasKey(key)) return getBoolValue(key);
|
||||
return defaultValue;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
} // namespace ddkit
|
||||
Reference in new issue
Block a user