EHS
Loading...
Searching...
No Matches
JsonArray.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Str.h"
5#include "JsonBase.h"
6
7namespace ehs
8{
9 class JsonObj;
10 class JsonBool;
11 class JsonNum;
12 class JsonStr;
13
14 class EHS_LIB_IO JsonArray : public JsonBase
15 {
16 private:
17 UInt_64 size;
18 UInt_64 extra;
19 UInt_64 rawSize;
20 JsonBase** data;
21
22 public:
23 ~JsonArray() override;
24
25 JsonArray();
26
27 JsonArray(UInt_64 extra);
28
29 JsonArray(UInt_64 size, UInt_64 extra);
30
31 JsonArray(JsonArray&& ja) noexcept;
32
33 JsonArray(const JsonArray& ja);
34
35 JsonArray& operator=(JsonArray&& ja) noexcept;
36
37 JsonArray& operator=(const JsonArray& ja);
38
39 operator JsonBase* const *() const;
40
41 operator JsonBase**();
42
43 UInt_64 RawSize() const;
44
45 UInt_64 Extra() const;
46
47 UInt_64 Size() const;
48
49 void Insert(UInt_64 index, const JsonBase* value);
50
51 void Push(const JsonBase* value);
52
53 void Push(const JsonBase& value);
54
55 void Push(const JsonObj& value);
56
57 void Push(const JsonArray& value);
58
59 void Push(const JsonBool& value);
60
61 void Push(bool value);
62
63 void Push(const JsonNum& value);
64
65 void Push(float value);
66
67 void Push(const JsonStr& value);
68
69 void Push(const Char_8* value, UInt_64 size = 0);
70
71 void Push(const Str_8& value);
72
73 void Pop();
74
75 Str_8 ToStr(UInt_64 level, bool compact) const override;
76 };
77}
UInt_64 Extra() const
Definition JsonArray.cpp:147
Str_8 ToStr(UInt_64 level, bool compact) const override
Definition JsonArray.cpp:494
UInt_64 RawSize() const
Definition JsonArray.cpp:142
void Pop()
Definition JsonArray.cpp:480
UInt_64 Size() const
Definition JsonArray.cpp:152
JsonArray & operator=(JsonArray &&ja) noexcept
Definition JsonArray.cpp:70
void Push(const JsonBase *value)
Definition JsonArray.cpp:198
JsonArray()
Definition JsonArray.cpp:17
void Insert(UInt_64 index, const JsonBase *value)
Definition JsonArray.cpp:157
JsonBase()
Definition JsonBase.cpp:5
Definition JsonBool.h:11
Definition JsonNum.h:11
Definition JsonObj.h:13
Definition JsonStr.h:11
Definition Anchor.h:6
char Char_8
Definition Types.h:40
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1953