Util: Add JSON Array/Object/Value types

This commit is contained in:
Riyyi
2022-06-07 12:46:13 +02:00
parent 1c676f9548
commit 0880d98fe0
4 changed files with 253 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2022 Riyyi
*
* SPDX-License-Identifier: MIT
*/
#ifndef JSON_ARRAY_H
#define JSON_ARRAY_H
#include <utility> // move
#include <vector>
#include "util/json/parser.h"
namespace Json {
class Array {
public:
Array() {}
virtual ~Array() {}
Array(const Array& other)
: m_values(other.m_values)
{
}
void emplace(Value value)
{
m_values.emplace_back(std::move(value));
}
private:
std::vector<Value> m_values;
};
} // namespace Json
#endif // JSON_ARRAY_H