JsonBuffer.cpp 481 B

1234567891011121314151617181920212223
  1. #include "JsonBuffer.h"
  2. #include <string.h> // for memset
  3. #include "JsonObject.h"
  4. #include "JsonValue.h"
  5. #include "Internals/JsonNode.h"
  6. JsonValue JsonBuffer::createValue()
  7. {
  8. JsonNode* node = createNode(JSON_UNDEFINED);
  9. return JsonValue(node);
  10. }
  11. JsonNode* JsonBuffer::createNode(JsonNodeType type)
  12. {
  13. JsonNode* node = allocateNode();
  14. if (!node) return 0;
  15. memset(node, 0, sizeof(JsonNode));
  16. node->type = type;
  17. return node;
  18. }