77 lines
1.3 KiB
C
77 lines
1.3 KiB
C
|
#pragma once
|
||
|
|
||
|
#include "ehs/EHS.h"
|
||
|
#include "ehs/Str.h"
|
||
|
#include "JsonBase.h"
|
||
|
|
||
|
namespace ehs
|
||
|
{
|
||
|
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;
|
||
|
};
|
||
|
}
|