44 void BeginArray(
const char * nodeName =
nullptr);
57 template <
typename T,
size_t N>
void Add(std::array<T, N>
const& values,
const Util::String& name =
"");
67 void AddString(const Util::String & value);
69 void AddBool(bool value);
71 void AddInt(int value);
73 void AddFloat(float value);
75 void AddFloat2(const Math::vec2 & value);
77 void AddVec4(const Math::vec4 & value);
79 void AddMatrix44(const Math::mat4 & value);
81 void AddTransform44(const Math::transform44 & value);
84 void SetString(const Util::String& name, const Util::String& value);
86 void SetBool(const Util::String& name, bool value);
88 void SetInt(const Util::String& name, int value);
90 void SetFloat(const Util::String& name, float value);
92 void SetVec2(const Util::String& name, const Math::vec2& value);
94 void SetVec4(const Util::String& name, const Math::vec4& value);
96 void SetMat4(const Util::String& name, const Math::mat4& value);
98 void SetTransform44(const Util::String& name, const Math::transform44& value);
100 template<typename T> void Set(const Util::String& name, const T &value);
137template<
typename T,
size_t N>
142 for (T
const& value : values)
152template<
unsigned int N>
157 for (
uint i = 0; i < N; i++)
164 this->
Add(tempArr, name);
JsonWriter()
constructor
Definition jsonwriter.cc:26
__DeclareClass(JsonWriter)
virtual bool Open()
begin writing the stream
Definition jsonwriter.cc:47
pjson::document * document
add a value to current object node
Definition jsonwriter.h:105
void AddRaw(const char *jsonText, const Util::String &name="")
add a json subtree that was built elsewhere and is only known as text.
Definition jsonwriter.cc:771
void BeginObject(const char *nodeName=nullptr)
begin a new node that can host key-value pairs
Definition jsonwriter.cc:100
virtual void Close()
end writing the stream
Definition jsonwriter.cc:66
void Add(const T &value, const Util::String &name="")
add a value to the current array node
void End()
end current object or array
Definition jsonwriter.cc:113
Util::Stack< pjson::value_variant * > hierarchy
Definition jsonwriter.h:106
void BeginArray(const char *nodeName=nullptr)
begin a new array node
Definition jsonwriter.cc:87
Util::Stack< Util::String > nameHierarchy
Definition jsonwriter.h:107
Stream writer classes provide a specialized write-interface for a stream.
Definition streamwriter.h:22
Nebula's dynamic array class.
Definition array.h:61
void Append(const TYPE &first, const ELEM_TYPE &... elements)
Append multiple elements to the end of the array.
Definition array.h:1415
Implements large bit field.
Definition bitfield.h:43
constexpr bool IsSet(const uint64_t bitIndex) const
Check if single bit is set.
Definition bitfield.h:187
A four-character-code is a quasi-human-readable 32-bit-id.
Definition fourcc.h:19
Nebula's stack class (a FILO container).
Definition stack.h:19
A StringAtom.
Definition stringatom.h:22
Nebula's universal string class.
Definition string.h:50
const char * AsCharPtr() const
return contents as character pointer
Definition string.h:579
An "any type" variable.
Definition variant.h:32
Instances of wrapped stream classes.
Definition multiplayerfeatureunit.cc:324
Definition jsonreader.h:26
A 4x4 single point precision float matrix.
Definition mat4.h:55
A 2-component float vector class.
Definition vec2.h:21
A 3D vector.
Definition vec3.h:37
A 4D vector.
Definition vec4.h:24
unsigned int uint
Definition types.h:41