EHS/include/ehs/json/JsonArray.h

77 lines
1.2 KiB
C
Raw Permalink Normal View History

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:
~JsonArray() override;
2024-02-05 22:25:30 -08:00
JsonArray();
JsonArray(UInt_64 extra);
2024-02-05 22:25:30 -08:00
JsonArray(UInt_64 size, UInt_64 extra);
2024-02-05 22:25:30 -08:00
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(UInt_64 index, const JsonBase* value);
2024-02-05 22:25:30 -08:00
void Push(const JsonBase* value);
2024-02-05 22:25:30 -08:00
void Push(const JsonBase& value);
void Push(const JsonObj& value);
void Push(const JsonArray& value);
void Push(const JsonBool& value);
void Push(bool value);
2024-02-05 22:25:30 -08:00
void Push(const JsonNum& value);
void Push(float value);
2024-02-05 22:25:30 -08:00
void Push(const JsonStr& value);
void Push(const Char_8* value, UInt_64 size = 0);
2024-02-05 22:25:30 -08:00
void Push(const Str_8& value);
void Pop();
Str_8 ToStr(UInt_64 level, bool compact) const override;
2024-02-05 22:25:30 -08:00
};
}