#pragma once #ifdef PLATFORM_ESP32 #include "Preferences.h" #endif #ifdef PLATFORM_NATIVE #include class Preferences { public: std::string getString(const char * key, const std::string & defaultValue) const { std::string strKey(key); const auto it = strings_.find(strKey); return (it == string_.end()) ? defaultValue : *it; } size_t putString(const char * key, const char * value) { strings_[std::string(key)] = std::string(value); return std::strlen(value); } bool remove(const char * key) { return strings_.remove(key); } private: std::map strings_; }; #endif // PLATFORM_NATIVE