EHS
JsonObj.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Str.h"
5
6#include "JsonBase.h"
7
8namespace ehs
9{
10 class JsonVar;
11
12 class EHS_LIB_IO JsonObj final : public JsonBase
13 {
14 protected:
15 UInt_64 size;
16 UInt_64 extra;
17 UInt_64 rawSize;
19
20 public:
21 ~JsonObj() override;
22
23 JsonObj();
24
25 JsonObj(UInt_64 size, UInt_64 extra);
26
27 JsonObj(UInt_64 extra);
28
29 JsonObj(JsonObj &&value) noexcept;
30
31 JsonObj(const JsonObj &value);
32
33 JsonObj& operator=(JsonObj &&value) noexcept;
34
35 JsonObj& operator=(const JsonObj &value);
36
37 operator JsonVar *() const;
38
39 UInt_64 Size() const;
40
41 UInt_64 Extra() const;
42
43 UInt_64 RawSize() const;
44
45 bool HasVar(UInt_64 hashId) const;
46
47 bool HasVar(const Str_8 &identifier) const;
48
49 bool AddVar(const JsonVar &var);
50
51 const JsonVar *GetVar(UInt_64 hashId) const;
52
53 const JsonVar *GetVar(const Str_8& identifier) const;
54
55 JsonVar *GetVar(UInt_64 hashId);
56
57 JsonVar *GetVar(const Str_8& identifier);
58
59 Str_8 ToStr(UInt_64 level, bool compact) const override;
60 };
61}
Definition: JsonBase.h:19
Definition: JsonObj.h:13
UInt_64 size
Definition: JsonObj.h:15
UInt_64 extra
Definition: JsonObj.h:16
JsonVar * vars
Definition: JsonObj.h:18
UInt_64 rawSize
Definition: JsonObj.h:17
Definition: JsonVar.h:16
Definition: Anchor.h:6