1#include "VariableReader.h"
3#include "Foundation/Logging/Logger.h"
7#include "Services/Variables.h"
9#include "ReaderCommon.h"
16void Cogs::Core::readVariables(Variables & variables,
const Value & section,
const std::string & sectionHeader,
bool defaults)
18 for (
auto & m : section.GetObject()) {
19 auto jsonKey = toKey(m.name);
21 auto key = sectionHeader.size() ? (sectionHeader +
"." + jsonKey.to_string()) : jsonKey.to_string();
25 if (defaults && !variables.get(key)->isEmpty())
continue;
27 switch (m.value.GetType())
30 variables.set(key, m.value.GetString());
33 variables.set(key, m.value.GetDouble());
36 variables.set(key,
true);
39 variables.set(key,
false);
42 readVariables(variables, m.value, key, defaults);
46 auto arr = m.value.GetArray();
47 if (arr.Size() == 4) {
49 readArray(m.value, value,
nullptr);
50 variables.set(key, value);
Log implementation class.
constexpr Log getLogger(const char(&name)[LEN]) noexcept