le_json.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------25 * Parsing stops automatically when the end of the document is reached or an error is encountered.65 * calling le_json_SetEventHandler(). This will remain in effect until the parser finishes parsing71 * There is a global error handler that is also set when the parsing is started, and can be changed73 * context, and will therefore not get restored to a previous handler when the parsing of a member99 * 6. LE_JSON_OBJECT_MEMBER - If the event handler calls le_json_GetString(), it will return "name".123 //--------------------------------------------------------------------------------------------------136 //--------------------------------------------------------------------------------------------------140 //--------------------------------------------------------------------------------------------------158 //--------------------------------------------------------------------------------------------------164 //--------------------------------------------------------------------------------------------------166 (171 //--------------------------------------------------------------------------------------------------173 * Enumeration of the different types of errors that can be reported during JSON document parsing.175 //--------------------------------------------------------------------------------------------------184 //--------------------------------------------------------------------------------------------------192 //--------------------------------------------------------------------------------------------------194 (200 //--------------------------------------------------------------------------------------------------205 //--------------------------------------------------------------------------------------------------209 //--------------------------------------------------------------------------------------------------215 //--------------------------------------------------------------------------------------------------224 //--------------------------------------------------------------------------------------------------227 * This API Works Synchronously. This function returns when either parse is finished or there has230 //--------------------------------------------------------------------------------------------------239 //--------------------------------------------------------------------------------------------------245 //--------------------------------------------------------------------------------------------------254 //--------------------------------------------------------------------------------------------------260 //--------------------------------------------------------------------------------------------------267 //--------------------------------------------------------------------------------------------------273 //--------------------------------------------------------------------------------------------------280 //--------------------------------------------------------------------------------------------------284 //--------------------------------------------------------------------------------------------------300 //--------------------------------------------------------------------------------------------------308 //--------------------------------------------------------------------------------------------------315 //--------------------------------------------------------------------------------------------------321 //--------------------------------------------------------------------------------------------------328 //--------------------------------------------------------------------------------------------------337 //--------------------------------------------------------------------------------------------------344 //--------------------------------------------------------------------------------------------------350 //--------------------------------------------------------------------------------------------------357 //--------------------------------------------------------------------------------------------------366 //--------------------------------------------------------------------------------------------------373 //--------------------------------------------------------------------------------------------------377 * @warning This function can only be called inside event handlers when LE_JSON_NUMBER events are380 //--------------------------------------------------------------------------------------------------387 //--------------------------------------------------------------------------------------------------391 //--------------------------------------------------------------------------------------------------398 //--------------------------------------------------------------------------------------------------402 //--------------------------------------------------------------------------------------------------409 //--------------------------------------------------------------------------------------------------413 //--------------------------------------------------------------------------------------------------420 //--------------------------------------------------------------------------------------------------429 //--------------------------------------------------------------------------------------------------LE_API_JSON double le_json_GetNumber(void)void(* le_json_ErrorHandler_t)(le_json_Error_t error, const char *msg)Definition: le_json.h:194object started, subsequent object members are part of this objectDefinition: le_json.h:143LE_API_JSON void le_json_SyncParse(int fd, le_json_EventHandler_t eventHandler, le_json_ErrorHandler_t errorHandler, void *opaquePtr)string value received: call le_json_GetString() to get valueDefinition: le_json.h:148LE_API_JSON void * le_json_GetOpaquePtr(void)object member name received: Call le_json_GetString() to get nameDefinition: le_json.h:144object finished, subsequent members/values are outside this objectDefinition: le_json.h:145LE_API_JSON const char * le_json_GetString(void)number value received: call le_json_GetNumber() to get valueDefinition: le_json.h:149LE_API_JSON const char * le_json_GetEventName(le_json_Event_t event)LE_API_JSON void le_json_SetErrorHandler(le_json_ErrorHandler_t callbackFunc)LE_API_JSON le_json_ContextType_t le_json_GetContextType(void)LE_API_JSON void le_json_SetOpaquePtr(void *ptr)LE_API_JSON void le_json_Cleanup(le_json_ParsingSessionRef_t session)struct le_json_ParsingSession * le_json_ParsingSessionRef_tDefinition: le_json.h:206array started, upcoming values are elements of this arrayDefinition: le_json.h:146void(* le_json_EventHandler_t)(le_json_Event_t event)Definition: le_json.h:166LE_API_JSON le_json_ParsingSessionRef_t le_json_ParseString(const char *jsonString, le_json_EventHandler_t eventHandler, le_json_ErrorHandler_t errorHandler, void *opaquePtr)LE_API_JSON le_json_ParsingSessionRef_t le_json_GetSession(void)LE_API_JSON const char * le_json_GetContextName(le_json_ContextType_t context)LE_API_JSON size_t le_json_GetBytesRead(le_json_ParsingSessionRef_t session)LE_API_JSON void le_json_SetEventHandler(le_json_EventHandler_t callbackFunc)LE_FULL_API le_json_ParsingSessionRef_t le_json_Parse(int fd, le_json_EventHandler_t eventHandler, le_json_ErrorHandler_t errorHandler, void *opaquePtr)