109 lines
2.0 KiB
C
109 lines
2.0 KiB
C
|
#pragma once
|
||
|
|
||
|
#include "../EHS.h"
|
||
|
#include "../Str.h"
|
||
|
|
||
|
namespace lwe
|
||
|
{
|
||
|
class JsonBase;
|
||
|
class JsonObj;
|
||
|
class JsonArray;
|
||
|
class JsonBool;
|
||
|
class JsonNum;
|
||
|
class JsonStr;
|
||
|
|
||
|
class JsonVar
|
||
|
{
|
||
|
private:
|
||
|
UInt_64 hashId;
|
||
|
Str_8 id;
|
||
|
JsonBase* value;
|
||
|
|
||
|
public:
|
||
|
virtual ~JsonVar();
|
||
|
|
||
|
JsonVar();
|
||
|
|
||
|
JsonVar(Str_8 id);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonBase* const value);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonBase& value);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonObj& value);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonArray& value);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonBool& value);
|
||
|
|
||
|
JsonVar(Str_8 id, const bool boolean);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonNum& value);
|
||
|
|
||
|
JsonVar(Str_8 id, const SInt_64 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const UInt_64 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const SInt_32 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const UInt_32 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const SInt_16 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const UInt_16 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const SInt_8 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const UInt_8 num);
|
||
|
|
||
|
JsonVar(Str_8 id, const double num);
|
||
|
|
||
|
JsonVar(Str_8 id, const float num);
|
||
|
|
||
|
JsonVar(Str_8 id, const JsonStr& value);
|
||
|
|
||
|
JsonVar(Str_8 id, const Char_8* str, const UInt_64 size = 0);
|
||
|
|
||
|
JsonVar(Str_8 id, Str_8 str);
|
||
|
|
||
|
JsonVar(JsonVar&& var) noexcept;
|
||
|
|
||
|
JsonVar(const JsonVar& var);
|
||
|
|
||
|
JsonVar& operator=(JsonVar&& var) noexcept;
|
||
|
|
||
|
JsonVar& operator=(const JsonVar& var);
|
||
|
|
||
|
UInt_64 GetHashId() const;
|
||
|
|
||
|
Str_8 GetId() const;
|
||
|
|
||
|
void SetValue(const JsonBase* const newValue);
|
||
|
|
||
|
void SetValue(const JsonBase& newValue);
|
||
|
|
||
|
void SetValue(const JsonObj& newValue);
|
||
|
|
||
|
void SetValue(const JsonArray& newValue);
|
||
|
|
||
|
void SetValue(const JsonBool& newValue);
|
||
|
|
||
|
void SetValue(const bool newValue);
|
||
|
|
||
|
void SetValue(const JsonNum& newValue);
|
||
|
|
||
|
void SetValue(const float newValue);
|
||
|
|
||
|
void SetValue(const JsonStr& newValue);
|
||
|
|
||
|
void SetValue(const Char_8* newValue, const UInt_64 size = 0);
|
||
|
|
||
|
void SetValue(const Str_8& newValue);
|
||
|
|
||
|
const JsonBase* GetValue() const;
|
||
|
|
||
|
JsonBase* GetValue();
|
||
|
|
||
|
Str_8 ToStr(const UInt_64 level, const bool compact) const;
|
||
|
};
|
||
|
}
|