JsonHashTable.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Arduino JSON library
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #pragma once
  6. #include "JsonValue.h"
  7. namespace ArduinoJson
  8. {
  9. namespace Parser
  10. {
  11. class JsonArray;
  12. class JsonHashTable
  13. {
  14. friend class JsonValue;
  15. public:
  16. JsonHashTable() {}
  17. bool success()
  18. {
  19. return value.success();
  20. }
  21. JsonValue operator[](const char* key)
  22. {
  23. return value[key];
  24. }
  25. bool containsKey(const char* key)
  26. {
  27. return value[key];
  28. }
  29. DEPRECATED JsonArray getArray(const char* key);
  30. DEPRECATED bool getBool(const char* key)
  31. {
  32. return value[key];
  33. }
  34. DEPRECATED double getDouble(const char* key)
  35. {
  36. return value[key];
  37. }
  38. DEPRECATED JsonHashTable getHashTable(const char* key)
  39. {
  40. return value[key];
  41. }
  42. DEPRECATED long getLong(const char* key)
  43. {
  44. return value[key];
  45. }
  46. DEPRECATED char* getString(const char* key)
  47. {
  48. return value[key];
  49. }
  50. private:
  51. JsonHashTable(JsonValue& value)
  52. : value(value)
  53. {
  54. }
  55. JsonValue value;
  56. };
  57. }
  58. }