2024-02-05 22:25:30 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ehs/EHS.h"
|
|
|
|
#include "ehs/Str.h"
|
|
|
|
#include "JsonBase.h"
|
|
|
|
|
|
|
|
namespace ehs
|
|
|
|
{
|
|
|
|
class JsonObj;
|
|
|
|
class JsonBool;
|
|
|
|
class JsonNum;
|
|
|
|
class JsonStr;
|
|
|
|
|
2024-07-24 01:36:20 -07:00
|
|
|
class EHS_LIB_IO JsonArray : public JsonBase
|
2024-02-05 22:25:30 -08:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|