JsonHashTable.h 730 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * malloc-free JSON parser for Arduino
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #ifndef __JSONHASHTABLE_H
  6. #define __JSONHASHTABLE_H
  7. #include "JsonObjectBase.h"
  8. class JsonArray;
  9. class JsonHashTable : public JsonObjectBase
  10. {
  11. template <int N>
  12. friend class JsonParser;
  13. friend class JsonArray;
  14. public:
  15. JsonHashTable() {}
  16. bool containsKey(const char* key);
  17. JsonArray getArray(const char* key);
  18. bool getBool(const char* key);
  19. double getDouble(const char* key);
  20. JsonHashTable getHashTable(const char* key);
  21. long getLong(const char* key);
  22. char* getString(const char* key);
  23. private:
  24. JsonHashTable(char* json, jsmntok_t* tokens);
  25. jsmntok_t* getToken(const char* key);
  26. };
  27. #endif