Util: Forward declare Json::Value in Array and Object class

This commit is contained in:
Riyyi
2022-07-08 13:29:23 +02:00
parent 0465d5802a
commit d9cfd3f7c1
4 changed files with 60 additions and 26 deletions
+26
View File
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2022 Riyyi
*
* SPDX-License-Identifier: MIT
*/
#include "util/json/object.h"
#include "util/json/value.h"
namespace Json {
void Object::emplace(const std::string& name, Value value)
{
m_members.emplace(name, std::move(value));
}
Value& Object::at(const std::string& name)
{
if (m_members.find(name) == m_members.end()) {
emplace(name, {});
}
return m_members.at(name);
}
} // namespace Json