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/array.h"
#include "util/json/value.h"
namespace Json {
void Array::emplace_back(Value value)
{
m_values.emplace_back(std::move(value));
}
Value& Array::at(size_t index)
{
if (index + 1 > m_values.size()) {
m_values.resize(index + 1);
}
return m_values.at(index);
}
} // namespace Json