add dv::merge & update EnginePaths::readCombinedObject

This commit is contained in:
MihailRis
2025-02-20 22:08:09 +03:00
parent 12105c2933
commit 84d5b5d1a8
5 changed files with 52 additions and 6 deletions
+2 -4
View File
@@ -253,7 +253,7 @@ dv::value ResPaths::readCombinedList(const std::string& filename) const {
return list;
}
dv::value ResPaths::readCombinedObject(const std::string& filename) const {
dv::value ResPaths::readCombinedObject(const std::string& filename, bool deep) const {
dv::value object = dv::object();
for (const auto& root : roots) {
auto path = root.path / filename;
@@ -267,9 +267,7 @@ dv::value ResPaths::readCombinedObject(const std::string& filename) const {
<< "reading combined object " << root.name << ": "
<< filename << " is not an object (skipped)";
}
for (const auto& [key, element] : value.asObject()) {
object[key] = element;
}
object.merge(std::move(value), deep);
} catch (const std::runtime_error& err) {
logger.warning() << "reading combined object " << root.name << ":"
<< filename << ": " << err.what();