Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
jsonapi.c
Go to the documentation of this file.
1
4// -------------------------------------------------------------------------
5// error codes for handle processing
6// defined in C++
8{
9 ETJSON_UNKNOWN, // invalid code
10
11 ETJSON_OK, // all fine
12 ETJSON_COMMSEND, // error during send
13 ETJSON_COMMRECV, // error during receive
14 ETJSON_PARSERERROR, // error during parsing
15 ETJSON_PACKNOSTART, // error - cannot start packing (invalid state)
16 ETJSON_TIMEOUT, // failed to send/ store handle due to timeout
17 ETJSON_NOBUFFERS, // not enough buffers available
18 ETJSON_FAILFILELOAD, // failed to load file
19 ETJSON_FAILFILESAVE, // failed to save file
20 ETJSON_NOTARRAY, // object is not array (ie. attempt to provide different or none object as array)
21};
22
23
24// -------------------------------------------------------------------------
25// JsonApi Handle is container encapsulating real JSON data being sent or recieved via. RESTful/ other service
27{
28 private void JsonApiHandle() {}
29 private void ~JsonApiHandle() {}
30
34 proto native int Size();
35
39 proto native owned string AsString();
40
44 proto native void Invalidate();
45
46};
47
48
49// -------------------------------------------------------------------------
50// parent class for handling JsonApi Struct objects
51//
52//
54{
55 private void JsonApi() {}
56 private void ~JsonApi() {}
57
61 proto native void SetBuffers( int iBufferCount );
62
66 proto native int BufferCount();
67
71 proto native int BufferMax();
72
76 proto native void DebugList();
77
78};
79
80
81// -------------------------------------------------------------------------
82// JsonApi access methods
83proto native JsonApi CreateJsonApi();
84proto native void DestroyJsonApi();
85proto native JsonApi GetJsonApi();
86
proto native JsonApi GetJsonApi()
EJsonApiError
Definition jsonapi.c:8
@ ETJSON_COMMRECV
Definition jsonapi.c:13
@ ETJSON_FAILFILELOAD
Definition jsonapi.c:18
@ ETJSON_FAILFILESAVE
Definition jsonapi.c:19
@ ETJSON_PACKNOSTART
Definition jsonapi.c:15
@ ETJSON_NOTARRAY
Definition jsonapi.c:20
@ ETJSON_PARSERERROR
Definition jsonapi.c:14
@ ETJSON_OK
Definition jsonapi.c:11
@ ETJSON_NOBUFFERS
Definition jsonapi.c:17
@ ETJSON_UNKNOWN
Definition jsonapi.c:9
@ ETJSON_COMMSEND
Definition jsonapi.c:12
@ ETJSON_TIMEOUT
Definition jsonapi.c:16
proto native void DestroyJsonApi()
proto native JsonApi CreateJsonApi()