OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
|
#include <Settings.h>
Public Member Functions | |
Settings () | |
Static Public Member Functions | |
static bool | set (const String &name, const String &value="") |
Set a value. More... | |
template<typename T > | |
static bool | set (const String &name, const T &value="") |
static bool | unset (const String &name) |
Removes key with given name from memory. More... | |
static bool | get (const String &name, String &value) |
Get a value from memory as String. More... | |
static bool | get (const String &name, float &value) |
Get a value from memory as float. More... | |
static bool | get (const String &name, int &value) |
Get a value from memory as int. More... | |
static bool | get (const String &name, long &value) |
Get a value from memory as long. More... | |
static String | getString (const String &name, const String dflt="") |
Get a value from memory as String with default. More... | |
static int | getInt (const String &name, const long dflt=-1) |
Get a value from memory as int with default. More... | |
static long | getLong (const String &name, const long dflt=-1) |
Get a value from memory as long with default. More... | |
static float | getFloat (const String &name, const float dflt=-1) |
Get a value from memory as float with default. More... | |
static bool | validName (const String &name) |
true if name is a valid name for a setting. More... | |
static String | list () |
List of values in memory. More... | |
static bool | fromList (String in) |
Stores all settings from a String into memory. More... | |
static bool | save (const String filename) |
Save settings to file in SPIFFS. More... | |
static bool | load (const String filename) |
Load settings from file in SPIFFS. More... | |
static bool | ls () |
Shows all files in the location SPIFFS_PREFIX in SPIFFS. More... | |
static bool | rm (const String filename) |
Deletes file from SPIFFS. More... | |
static bool | fileExists (String filename) |
See if given file exists in SPIFFS. More... | |
static void | zap () |
Deletes all settings from memory. More... | |
static bool | isSet (const String &name) |
Find out if a key with given name exists in memory. More... | |
Definition at line 31 of file Settings.h.
Settings::Settings | ( | ) |
Definition at line 11 of file Settings.cpp.
|
static |
Set a value.
name | name of the key to be set |
value | value to be set as an Arduino String |
Definition at line 188 of file Settings.cpp.
|
inlinestatic |
Definition at line 38 of file Settings.h.
|
static |
Removes key with given name from memory.
name | name of key |
true
if removed, false
if name not valid or key not set. Definition at line 199 of file Settings.cpp.
|
static |
Get a value from memory as String.
name | name of the key |
value | String variable that will hold the value on return |
true
if value found, false
if not Definition at line 211 of file Settings.cpp.
|
static |
Get a value from memory as float.
name | name of the key |
value | float variable that will hold the value on return |
true
if value found, false
if not Definition at line 223 of file Settings.cpp.
|
static |
Get a value from memory as int.
name | name of the key |
value | int variable that will hold the value on return |
true
if value found, false
if not Definition at line 237 of file Settings.cpp.
|
static |
Get a value from memory as long.
name | name of the key |
value | long variable that will hold the value on return |
true
if value found, false
if not Definition at line 251 of file Settings.cpp.
|
static |
Get a value from memory as String with default.
name | name of the key |
dflt | [optional] Default returned if key not found in memory or "" if no default specified. |
Definition at line 265 of file Settings.cpp.
|
static |
Get a value from memory as int with default.
name | name of the key |
dflt | [optional] Default returned if key not found in memory or -1 if no default specified. |
Definition at line 276 of file Settings.cpp.
|
static |
Get a value from memory as long with default.
name | name of the key |
dflt | [optional] Default returned if key not found in memory or -1 if no default specified. |
Definition at line 287 of file Settings.cpp.
|
static |
Get a value from memory as float with default.
name | name of the key |
dflt | [optional] Default returned if key not found in memory or -1 if no default specified. |
Definition at line 298 of file Settings.cpp.
|
static |
true
if name is a valid name for a setting.
Definition at line 143 of file Settings.cpp.
|
static |
List of values in memory.
Definition at line 159 of file Settings.cpp.
|
static |
Stores all settings from a String into memory.
in | String that contains name=value<lf>name=value<lf>... |
true
if it worked, displays error and returns false
if not. Definition at line 122 of file Settings.cpp.
|
static |
Save settings to file in SPIFFS.
filename | The actual filename in SPIFFS will have SPIFFS_PREFIX from config.h preprended |
true
if it worked, displays error and returns false
if not. Definition at line 18 of file Settings.cpp.
|
static |
Load settings from file in SPIFFS.
filename | The actual filename in SPIFFS will have SPIFFS_PREFIX from config.h preprended |
true
if it worked, displays error and returns false
if not. Definition at line 44 of file Settings.cpp.
|
static |
Shows all files in the location SPIFFS_PREFIX in SPIFFS.
true
if it worked, displays error and returns false
if not. Definition at line 68 of file Settings.cpp.
|
static |
Deletes file from SPIFFS.
filename | The actual filename in SPIFFS will have SPIFFS_PREFIX from config.h preprended |
true
if it worked, displays error and returns false
if not. Definition at line 85 of file Settings.cpp.
|
static |
See if given file exists in SPIFFS.
filename | The actual filename in SPIFFS will have SPIFFS_PREFIX from config.h preprended |
true
if file exists, false
if not. Definition at line 102 of file Settings.cpp.
|
static |
Deletes all settings from memory.
Definition at line 115 of file Settings.cpp.
|
static |
Find out if a key with given name exists in memory.
name | Setting name |
true
if that name is set Definition at line 180 of file Settings.cpp.