A board support package for the LPC4088 Display Module.
Dependencies: DM_HttpServer DM_USBHost
Dependents: lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more
Fork of DMSupport by
Registry Class Reference
Example of using the Registry class: More...
#include <Registry.h>
Public Member Functions | |
RegistryError | load () |
Loads all (if any) values from the internal EEPROM. | |
RegistryError | setValue (const char *key, const char *val) |
Sets (or replaces if existing) the value for the key. | |
RegistryError | getValue (const char *key, char **pVal) |
Gets (if any) the the value for the key. | |
RegistryError | entryAt (int pos, char **pKey, char **pVal) |
Retrieves the key-value pair at the specified index. | |
int | numEntries () |
Returns the number of key-value pairs in the registry. | |
RegistryError | store () |
Stores the registry in the internal EEPROM. | |
Static Public Member Functions | |
static Registry & | instance () |
Get the only instance of the Registry. |
Detailed Description
Example of using the Registry class:
#include "mbed.h" #include "DMBoard.h" int main(void) { DMBoard* board = &DMBoard::instance(); board->init(); ... board->registry() }
Definition at line 39 of file Registry.h.
Member Function Documentation
Registry::RegistryError entryAt | ( | int | pos, |
char ** | pKey, | ||
char ** | pVal | ||
) |
Retrieves the key-value pair at the specified index.
If Ok is returned then pKey and pVal will point to allocated memory that must be deallocated with free() by the caller.
- Parameters:
-
pos the index to look for pKey will hold the key if successful pVal will hold the value if successful
- Returns:
- Ok on success An error code on failure
Definition at line 239 of file Registry.cpp.
Registry::RegistryError getValue | ( | const char * | key, |
char ** | pVal | ||
) |
Gets (if any) the the value for the key.
If Ok is returned then pVal will point to allocated memory that must be deallocated with free() by the caller.
- Parameters:
-
key the key to look for pVal will hold the value if successful
- Returns:
- Ok on success NoSuchKeyError if there is no value for the key An error code on failure
Definition at line 219 of file Registry.cpp.
static Registry& instance | ( | ) | [static] |
Get the only instance of the Registry.
- Returns:
- The Registry
Definition at line 59 of file Registry.h.
Registry::RegistryError load | ( | ) |
Loads all (if any) values from the internal EEPROM.
- Returns:
- Ok on success An error code on failure
Definition at line 144 of file Registry.cpp.
int numEntries | ( | ) |
Returns the number of key-value pairs in the registry.
- Returns:
- the number of key-value pairs
Definition at line 121 of file Registry.h.
Registry::RegistryError setValue | ( | const char * | key, |
const char * | val | ||
) |
Sets (or replaces if existing) the value for the key.
The key/value parameters are copied so it is ok to free them after calling this function.
- Parameters:
-
key the key to create or update val the value to store for the key
- Returns:
- Ok on success An error code on failure
Definition at line 182 of file Registry.cpp.
Registry::RegistryError store | ( | ) |
Stores the registry in the internal EEPROM.
- Returns:
- Ok on success An error code on failure
Definition at line 271 of file Registry.cpp.
Generated on Tue Jul 12 2022 14:18:31 by 1.7.2