EHS/include/Json/JsonObj.h

63 lines
1.0 KiB
C
Raw Normal View History

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 JsonVar;
class JsonObj : public JsonBase
{
protected:
UInt_64 size;
UInt_64 extra;
UInt_64 rawSize;
JsonVar* vars;
public:
virtual ~JsonObj();
JsonObj();
JsonObj(const UInt_64 size, const UInt_64 extra);
JsonObj(const UInt_64 extra);
JsonObj(JsonObj&& value) noexcept;
JsonObj(const JsonObj& value);
JsonObj& operator=(JsonObj&& value) noexcept;
JsonObj& operator=(const JsonObj& value);
operator const JsonVar*() const;
operator JsonVar*();
UInt_64 Size() const;
UInt_64 Extra() const;
UInt_64 RawSize() const;
bool HasVar(const UInt_64 hashId) const;
bool HasVar(const Str_8& identifier) const;
bool AddVar(const JsonVar& var);
const JsonVar* GetVar(const UInt_64 hashId) const;
const JsonVar* GetVar(const Str_8& identifier) const;
JsonVar* GetVar(const UInt_64 hashId);
JsonVar* GetVar(const Str_8& identifier);
Str_8 ToStr(const UInt_64 level, const bool compact) const;
};
}