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 EmbeddedArtists AB

Embed: (wiki syntax)

« Back to documentation index

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 Registryinstance ()
 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:
posthe index to look for
pKeywill hold the key if successful
pValwill 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:
keythe key to look for
pValwill 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:
keythe key to create or update
valthe 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.