le_json.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
123 //--------------------------------------------------------------------------------------------------
124 
132 #ifndef LEGATO_JSON_H_INCLUDE_GUARD
133 #define LEGATO_JSON_H_INCLUDE_GUARD
134 
135 
136 //--------------------------------------------------------------------------------------------------
140 //--------------------------------------------------------------------------------------------------
141 typedef enum
142 {
154 }
156 
157 
158 //--------------------------------------------------------------------------------------------------
164 //--------------------------------------------------------------------------------------------------
165 typedef void (* le_json_EventHandler_t)
166 (
167  le_json_Event_t event
168 );
169 
170 
171 //--------------------------------------------------------------------------------------------------
175 //--------------------------------------------------------------------------------------------------
176 typedef enum
177 {
180 }
182 
183 
184 //--------------------------------------------------------------------------------------------------
192 //--------------------------------------------------------------------------------------------------
193 typedef void (* le_json_ErrorHandler_t)
194 (
195  le_json_Error_t error,
196  const char* msg
197 );
198 
199 
200 //--------------------------------------------------------------------------------------------------
205 //--------------------------------------------------------------------------------------------------
206 typedef struct le_json_ParsingSession* le_json_ParsingSessionRef_t;
207 
208 
209 //--------------------------------------------------------------------------------------------------
215 //--------------------------------------------------------------------------------------------------
217 (
218  int fd,
219  le_json_EventHandler_t eventHandler,
220  le_json_ErrorHandler_t errorHandler,
221  void* opaquePtr
222 );
223 
224 
225 //--------------------------------------------------------------------------------------------------
231 //--------------------------------------------------------------------------------------------------
232 void le_json_Cleanup
233 (
235 );
236 
237 
238 //--------------------------------------------------------------------------------------------------
244 //--------------------------------------------------------------------------------------------------
246 (
247  le_json_EventHandler_t callbackFunc
248 );
249 
250 
251 //--------------------------------------------------------------------------------------------------
255 //--------------------------------------------------------------------------------------------------
256 typedef enum
257 {
267 }
269 
270 
271 //--------------------------------------------------------------------------------------------------
279 //--------------------------------------------------------------------------------------------------
281 (
282  void
283 );
284 
285 
286 //--------------------------------------------------------------------------------------------------
292 //--------------------------------------------------------------------------------------------------
294 (
295  void* ptr
296 );
297 
298 
299 //--------------------------------------------------------------------------------------------------
308 //--------------------------------------------------------------------------------------------------
310 (
311  void
312 );
313 
314 
315 //--------------------------------------------------------------------------------------------------
321 //--------------------------------------------------------------------------------------------------
323 (
324  le_json_ErrorHandler_t callbackFunc
325 );
326 
327 
328 //--------------------------------------------------------------------------------------------------
337 //--------------------------------------------------------------------------------------------------
338 const char* le_json_GetString
339 (
340  void
341 );
342 
343 
344 //--------------------------------------------------------------------------------------------------
351 //--------------------------------------------------------------------------------------------------
352 double le_json_GetNumber
353 (
354  void
355 );
356 
357 
358 //--------------------------------------------------------------------------------------------------
362 //--------------------------------------------------------------------------------------------------
363 const char* le_json_GetEventName
364 (
365  le_json_Event_t event
366 );
367 
368 
369 //--------------------------------------------------------------------------------------------------
373 //--------------------------------------------------------------------------------------------------
374 const char* le_json_GetContextName
375 (
376  le_json_ContextType_t context
377 );
378 
379 
380 //--------------------------------------------------------------------------------------------------
384 //--------------------------------------------------------------------------------------------------
386 (
388 );
389 
390 
391 //--------------------------------------------------------------------------------------------------
400 //--------------------------------------------------------------------------------------------------
402 (
403  void
404 );
405 
406 
407 #endif // LEGATO_JSON_H_INCLUDE_GUARD
array finished, subsequent values are outside this array
Definition: le_json.h:147
Syntax error, such as a missing comma or extra comma.
Definition: le_json.h:178
Parsing number value.
Definition: le_json.h:263
Parsing a member of an object.
Definition: le_json.h:260
void le_json_SetEventHandler(le_json_EventHandler_t callbackFunc)
void(* le_json_ErrorHandler_t)(le_json_Error_t error, const char *msg)
Definition: le_json.h:194
le_json_ParsingSessionRef_t le_json_GetSession(void)
object started, subsequent object members are part of this object
Definition: le_json.h:143
const char * le_json_GetString(void)
true value received
Definition: le_json.h:150
string value received: call le_json_GetString() to get value
Definition: le_json.h:148
Top level of document, outside the main object/array.
Definition: le_json.h:258
const char * le_json_GetEventName(le_json_Event_t event)
End of the document reached. Parsing has stopped.
Definition: le_json.h:153
object member name received: Call le_json_GetString() to get name
Definition: le_json.h:144
object finished, subsequent members/values are outside this object
Definition: le_json.h:145
Parsing a false value.
Definition: le_json.h:265
void * le_json_GetOpaquePtr(void)
Parsing a true value.
Definition: le_json.h:264
Error when reading from the input byte stream.
Definition: le_json.h:179
Parsing a string value.
Definition: le_json.h:262
number value received: call le_json_GetNumber() to get value
Definition: le_json.h:149
Parsing a null value.
Definition: le_json.h:266
le_json_ParsingSessionRef_t le_json_Parse(int fd, le_json_EventHandler_t eventHandler, le_json_ErrorHandler_t errorHandler, void *opaquePtr)
Parsing an array (list of unnamed elements).
Definition: le_json.h:261
void le_json_SetErrorHandler(le_json_ErrorHandler_t callbackFunc)
le_json_ContextType_t le_json_GetContextType(void)
null value received
Definition: le_json.h:152
size_t le_json_GetBytesRead(le_json_ParsingSessionRef_t session)
struct le_json_ParsingSession * le_json_ParsingSessionRef_t
Definition: le_json.h:206
le_json_Event_t
Definition: le_json.h:141
le_json_Error_t
Definition: le_json.h:176
void le_json_SetOpaquePtr(void *ptr)
false value received
Definition: le_json.h:151
array started, upcoming values are elements of this array
Definition: le_json.h:146
le_json_ContextType_t
Definition: le_json.h:256
void(* le_json_EventHandler_t)(le_json_Event_t event)
Definition: le_json.h:166
Parsing an object (set of named members).
Definition: le_json.h:259
double le_json_GetNumber(void)
void le_json_Cleanup(le_json_ParsingSessionRef_t session)
const char * le_json_GetContextName(le_json_ContextType_t context)