2023-12-17 03:29:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-17 15:00:08 -08:00
|
|
|
#include "EHS.h"
|
|
|
|
#include "Str.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
#include "JsonBase.h"
|
|
|
|
|
|
|
|
namespace lwe
|
|
|
|
{
|
|
|
|
class JsonObj;
|
|
|
|
class JsonBool;
|
|
|
|
class JsonNum;
|
|
|
|
class JsonStr;
|
|
|
|
|
|
|
|
class JsonArray : public JsonBase
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
UInt_64 size;
|
|
|
|
UInt_64 extra;
|
|
|
|
UInt_64 rawSize;
|
|
|
|
JsonBase** data;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~JsonArray();
|
|
|
|
|
|
|
|
JsonArray();
|
|
|
|
|
|
|
|
JsonArray(const UInt_64 extra);
|
|
|
|
|
|
|
|
JsonArray(const UInt_64 size, const UInt_64 extra);
|
|
|
|
|
|
|
|
JsonArray(JsonArray&& ja) noexcept;
|
|
|
|
|
|
|
|
JsonArray(const JsonArray& ja);
|
|
|
|
|
|
|
|
JsonArray& operator=(JsonArray&& ja) noexcept;
|
|
|
|
|
|
|
|
JsonArray& operator=(const JsonArray& ja);
|
|
|
|
|
|
|
|
operator JsonBase* const *() const;
|
|
|
|
|
|
|
|
operator JsonBase**();
|
|
|
|
|
|
|
|
UInt_64 RawSize() const;
|
|
|
|
|
|
|
|
UInt_64 Extra() const;
|
|
|
|
|
|
|
|
UInt_64 Size() const;
|
|
|
|
|
|
|
|
void Insert(const UInt_64 index, const JsonBase* const value);
|
|
|
|
|
|
|
|
void Push(const JsonBase* const value);
|
|
|
|
|
|
|
|
void Push(const JsonBase& value);
|
|
|
|
|
|
|
|
void Push(const JsonObj& value);
|
|
|
|
|
|
|
|
void Push(const JsonArray& value);
|
|
|
|
|
|
|
|
void Push(const JsonBool& value);
|
|
|
|
|
|
|
|
void Push(const bool value);
|
|
|
|
|
|
|
|
void Push(const JsonNum& value);
|
|
|
|
|
|
|
|
void Push(const float value);
|
|
|
|
|
|
|
|
void Push(const JsonStr& value);
|
|
|
|
|
|
|
|
void Push(const Char_8* value, const UInt_64 size = 0);
|
|
|
|
|
|
|
|
void Push(const Str_8& value);
|
|
|
|
|
|
|
|
void Pop();
|
|
|
|
|
|
|
|
Str_8 ToStr(const UInt_64 level, const bool compact) const;
|
|
|
|
};
|
|
|
|
}
|