cJSON_Utils.h 844 B

12345678910111213141516171819
  1. #include "cJSON.h"
  2. // Implement RFC6901 (https://tools.ietf.org/html/rfc6901) JSON Pointer spec.
  3. cJSON *cJSONUtils_GetPointer(cJSON *object,const char *pointer);
  4. // Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec.
  5. //cJSON* cJSONUtils_GeneratePatches(cJSON *from,cJSON *to); // Not yet implemented.
  6. int cJSONUtils_ApplyPatches(cJSON *object,cJSON *patches); // Returns 0 for success.
  7. // Note that ApplyPatches is NOT atomic on failure. To implement an atomic ApplyPatches, use:
  8. //int cJSONUtils_AtomicApplyPatches(cJSON **object, cJSON *patches)
  9. //{
  10. // cJSON *modme=cJSON_Duplicate(*object,1);
  11. // int error=cJSONUtils_ApplyPatches(modme,patches);
  12. // if (!error) {cJSON_Delete(*object);*object=modme;}
  13. // else cJSON_Delete(modme);
  14. // return error;
  15. //}
  16. // Code not added to library since this strategy is a LOT slower.