JsonObjectKeyValue.hpp 830 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "ArduinoJson/JsonValue.hpp"
  3. namespace ArduinoJson
  4. {
  5. class JsonObjectKeyValue
  6. {
  7. public:
  8. explicit JsonObjectKeyValue(Internals::JsonNode* node)
  9. : _node(node)
  10. {
  11. }
  12. const char* key() const
  13. {
  14. return _node->getAsObjectKey();
  15. }
  16. JsonValue value()
  17. {
  18. return JsonValue(_node->getAsObjectValue());
  19. }
  20. bool operator==(const JsonObjectKeyValue& other) const
  21. {
  22. return _node == other._node;
  23. }
  24. bool operator!=(const JsonObjectKeyValue& other) const
  25. {
  26. return _node != other._node;
  27. }
  28. Internals::JsonNode* next()
  29. {
  30. return _node->next;
  31. }
  32. private:
  33. Internals::JsonNode* _node;
  34. };
  35. }