overload Preferences.getBytes similar to nvs so you can get size of t… (#2498)

* overload Preferences.getBytes similar to nvs so you can get size of the array.

* Cleaner implentation, with a separate function to get length.  Added an example
This commit is contained in:
lbernstone
2019-04-09 18:45:38 -06:00
committed by Me No Dev
parent 91508030d8
commit da8b7c1b80
3 changed files with 55 additions and 3 deletions

View File

@ -63,6 +63,7 @@ class Preferences {
bool getBool(const char* key, bool defaultValue = false);
size_t getString(const char* key, char* value, size_t maxLen);
String getString(const char* key, String defaultValue = String());
size_t getBytesLength(const char* key);
size_t getBytes(const char* key, void * buf, size_t maxLen);
size_t freeEntries();
};