21 #ifndef LIB_LIGHTMETRICA_CONFIG_NODE_H
22 #define LIB_LIGHTMETRICA_CONFIG_NODE_H
26 #include "math.types.h"
67 const Config* GetConfig()
const;
82 ConfigNode Child(
const std::string& name)
const;
101 ConfigNode NextChild(
const std::string& name)
const;
107 std::string Name()
const;
113 std::string Value()
const;
120 template <
typename T>
128 std::string AttributeValue(
const std::string& name)
const;
139 template <
typename T>
142 const auto child = Child(name);
145 LM_LOG_WARN(
"Missing '" + name +
"' element. Using default value.");
146 value = defaultValue;
150 value = child.Value<T>();
163 template <
typename T>
166 const auto child = Child(name);
169 LM_LOG_ERROR(
"Missing '" + name +
"' element");
173 value = child.Value<T>();
185 extern template LM_PUBLIC_API std::string ConfigNode::Value<std::string>()
const;
186 extern template LM_PUBLIC_API
int ConfigNode::Value<int>()
const;
187 extern template LM_PUBLIC_API
long long ConfigNode::Value<long long>()
const;
188 extern template LM_PUBLIC_API
bool ConfigNode::Value<bool>()
const;
189 extern template LM_PUBLIC_API Math::Float ConfigNode::Value<Math::Float>()
const;
190 extern template LM_PUBLIC_API Math::Vec3 ConfigNode::Value<Math::Vec3>()
const;
191 extern template LM_PUBLIC_API Math::Mat4 ConfigNode::Value<Math::Mat4>()
const;
192 extern template LM_PUBLIC_API std::vector<Math::Float> ConfigNode::Value<std::vector<Math::Float>>()
const;
193 extern template LM_PUBLIC_API std::vector<unsigned int> ConfigNode::Value<std::vector<unsigned int>>()
const;
198 #endif // LIB_LIGHTMETRICA_CONFIG_NODE_H
bool ChildValue(const std::string &name, T &value) const
Definition: confignode.h:164
Definition: confignode.h:37
bool ChildValueOrDefault(const std::string &name, const T &defaultValue, T &value) const
Definition: confignode.h:140