DynamicJsonBuffer.hpp 562 B

12345678910111213141516171819202122232425
  1. // Copyright Benoit Blanchon 2014
  2. // MIT License
  3. //
  4. // Arduino JSON library
  5. // https://github.com/bblanchon/ArduinoJson
  6. #pragma once
  7. #include "JsonBuffer.hpp"
  8. namespace ArduinoJson {
  9. // Implements a JsonBuffer with dynamic memory allocation.
  10. // You are strongly encouraged to consider using StaticJsonBuffer which is much
  11. // more suitable for embedded systems.
  12. class DynamicJsonBuffer : public JsonBuffer {
  13. public:
  14. explicit DynamicJsonBuffer() {}
  15. size_t size() const { return 0; }
  16. protected:
  17. virtual void* alloc(size_t bytes) { return NULL; }
  18. };
  19. }