40 #ifndef __OPENFLUID_TOOLS_SETTINGSBACKEND_HPP__
41 #define __OPENFLUID_TOOLS_SETTINGSBACKEND_HPP__
64 std::variant<std::monostate,bool,int,double,std::string,std::vector<std::string>> m_Value;
120 StngVal.m_JSONValue = Val;
134 const T
get(
const std::optional<T>& DefaultValue = std::nullopt)
const
136 if (std::holds_alternative<T>(m_Value))
138 return std::get<T>(m_Value);
141 if (DefaultValue.has_value())
143 return DefaultValue.value();
147 "Setting value is not of correct type");
167 return std::holds_alternative<T>(m_Value);
176 return !m_JSONValue.is_null();
185 return (m_Value.index() == 0) && (m_JSONValue.is_null());
220 std::string m_BackendFile;
224 void prepareForData();
228 bool autoSave()
const;
249 return m_BackendFile;
258 m_AutoSave = AutoSave;
267 return m_AutoSave && !m_BackendFile.empty();
306 void setValue(
const std::string& ParentPointer,
const std::string& Key,
319 bool exists(
const std::string& Pointer)
const;
Definition: FrameworkException.hpp:51
#define OPENFLUID_API
Definition: dllexport.hpp:86
nlohmann::ordered_json json
Definition: JSON.hpp:52
Definition: ApplicationException.hpp:47