EHS/include/ehs/json/JsonObj.h

63 lines
1.0 KiB
C
Raw 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 JsonVar;
2024-07-24 01:36:20 -07:00
class EHS_LIB_IO JsonObj : public JsonBase
2024-02-05 22:25:30 -08:00
{
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;
};
}