DayZ 1.24
Loading...
Searching...
No Matches
JsonApiStruct.c
Go to the documentation of this file.
1
4// -------------------------------------------------------------------------
5// object which allow to parse upon generic JSON structure and format it back
6//
7//
9{
10
12 {
13 }
14
16 {
17 }
18
22 void OnExpand()
23 {
24 }
25
29 void OnPack()
30 {
31 Print("OnPack() ");
32 }
33
38 {
39 }
40
45 {
46 // errorCode is EJsonApiError
47 }
48
53 {
54 // errorCode is EJsonApiError
55 }
56
60 void OnObject(string name)
61 {
62 Print("OnObject: " + name);
63 }
64
68 void OnInteger(string name, int value)
69 {
70 Print("OnInteger: " + value);
71 }
72
76 void OnFloat(string name, float value)
77 {
78 Print("OnFloat: " + value);
79 }
80
84 void OnBoolean(string name, bool value)
85 {
86 Print("OnBoolean: " + value);
87 }
88
92 void OnString(string name, string value)
93 {
94 Print("OnString: " + value);
95 }
96
100 void OnVector(string name, vector value)
101 {
102 Print("OnVector: " + value);
103 }
104
108 void OnStartArray(string name)
109 {
110 Print("OnStartArray: " + name);
111 }
112
117 {
118 Print("OnEndArray: " + itemCount);
119 }
120
124 void OnItemObject(int index, string name)
125 {
126 Print("OnItemObject: " + name);
127 }
128
132 void OnItemInteger(int index, int value)
133 {
134 Print("OnItemInteger: " + value);
135 }
136
140 void OnItemFloat(int index, float value)
141 {
142 Print("OnItemFloat: " + value);
143 }
144
148 void OnItemBoolean(int index, bool value)
149 {
150 Print("OnItemBoolean: " + value);
151 }
152
156 void OnItemString(int index, string value)
157 {
158 Print("OnItemString: " + value);
159 }
160
165 {
166 Print("OnItemVector: " + value);
167 }
168
172 proto native void RegV(string name);
173
178
183
188
193
197 proto native void StoreFloat(string name, float value);
198
202 proto native void StoreInteger(string name, int value);
203
207 proto native void StoreBoolean(string name, bool value);
208
212 proto native void StoreString(string name, string value);
213
218
223
228
233
238
243
248
253
258
263
268
273
278
283
288
301
302};
303
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native void StoreString(string name, string value)
Add string value to hierarchy.
proto native void SetDone()
Call this when you've done packing or unpacking (interrupt operation)
proto native string AsString()
Get packed JSON as string (!only if you called Pack() first, it may return null)
proto native void RegV(string name)
Register script variable for auto-feature.
proto native void StoreObject(string name, JsonApiStruct obj)
Add scripted object to hierarchy (calls through hierarchy)
proto native void Pack()
Start object packing - when it can be done (when sending remote etc.)
void OnExpand()
Event when expand (unpack) process starts.
proto native void EndArray()
End array at hierarchy - !!! Be cautious and doublecheck results when using this !...
void OnItemBoolean(int index, bool value)
Called when parsing boolean value.
proto native void StoreInteger(string name, int value)
Add integer value to hierarchy.
proto native bool SaveToFile(string FileName)
Save JSON to file (only If something was loaded or recieved previously!)
void OnVector(string name, vector value)
Called when parsing vector value.
proto native void ItemFloat(float value)
Add unnamed/ array float value.
proto native void SetFail()
Call this when you've done packing or unpacking + want to generate error - prevent to send invalid da...
proto native bool LoadFromFile(string FileName)
Load JSON from file and Expand.
void OnEndArray(int itemCount)
Called when array end, returns count of items.
void OnItemObject(int index, string name)
Called when parsing object.
void JsonApiStruct()
proto native void ItemString(string value)
Add unnamed/ array string value.
void OnObject(string name)
Called when parsing object.
proto native void ItemInteger(int value)
Add unnamed/ array integer value.
proto native void ItemObject(JsonApiStruct obj)
Add scripted unnamed/ array object.
void OnFloat(string name, float value)
Called when parsing float value.
proto native void StoreFloat(string name, float value)
Add float value to hierarchy.
void OnItemFloat(int index, float value)
Called when parsing float value.
proto native void EndObject()
End object at hierarchy - !!! Be cautious and doublecheck results when using this !...
void OnError(int errorCode)
Event called when pending store operation is finished - callback from JsonApiHandle before handle rel...
void OnPack()
Event when pack starts - you will pack your stuff here.
void OnSuccess(int errorCode)
Event called when pending store operation is finished - callback from JsonApiHandle before handle rel...
void OnItemVector(int index, vector value)
Called when parsing vector value from array.
void OnStartArray(string name)
Called when parsing array.
void OnBoolean(string name, bool value)
Called when parsing boolean value.
proto native void ItemVector(vector value)
Add unnamed/ array vector value.
proto native void InstantPack()
Start object packing now - for use at main thread only!
proto native void Push(JsonApiStruct obj)
Push object to parse (only during parse operation)
void OnString(string name, string value)
Called when parsing string value.
void OnBufferReady()
Verification event after successfull JSON packing.
void OnItemString(int index, string value)
Called when parsing string value from array.
proto native void ExpandFromRAW(string data)
Start object unpacking from RAW string data.
proto native void StartArray(string name)
Start array at hierarchy - !!! Be cautious and doublecheck results when using this !...
proto native void ItemBoolean(bool value)
Add unnamed/ array boolean value.
void ~JsonApiStruct()
proto native void StoreVector(string name, vector value)
Add vector value to hierarchy.
proto native void StoreBoolean(string name, bool value)
Add boolean value to hierarchy.
void OnInteger(string name, int value)
Called when parsing integer value.
proto native void StartObject(string name)
Start object at hierarchy - !!! Be cautious and doublecheck results when using this !...
void OnItemInteger(int index, int value)
Called when parsing integer value.
proto native bool PackToFile(string FileName)
Pack() and save JSON to file.
TODO doc.
Definition EnScript.c:118
proto void Print(void var)
Prints content of variable to console/log.