Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Functions
lampda::physical::fileSystem::user Namespace Reference

user file space. More...

Functions

bool doKeyExists (const uint32_t key)
 Return true if the given key exists in the filesystem.
 
bool get_value (const uint32_t key, uint32_t &value)
 Check and return a value stored in a filesystem.
 
void set_value (const uint32_t key, const uint32_t value)
 Store a key/value in the filesystem.
 
uint32_t dropMatchingKeys (const uint32_t bitMatch, const uint32_t bitSelect=0xffffffff)
 Drop all keys using the given bit prefix.
 
void write_to_file ()
 Write the user parameters to a file.
 
bool load_from_file ()
 Load user values from memory.
 

Detailed Description

user file space.

Function Documentation

◆ dropMatchingKeys()

uint32_t lampda::physical::fileSystem::user::dropMatchingKeys ( const uint32_t  bitMatch,
const uint32_t  bitSelect = 0xffffffff 
)

Drop all keys using the given bit prefix.

All keys such as bitMatch == (bitSelect & key) will be removed

Parameters
[in]bitMatchkeys matching this pattern will be dropped
[in]bitSelectselect which key bits to match with
Returns
count of elements removed from storage

◆ get_value()

bool lampda::physical::fileSystem::user::get_value ( const uint32_t  key,
uint32_t &  value 
)

Check and return a value stored in a filesystem.

Parameters
[in]keyThe key to get the value from
[out]valueThe associated value, if the function returns true
Returns
true if the key exists and has a value

◆ load_from_file()

bool lampda::physical::fileSystem::user::load_from_file ( )

Load user values from memory.

Returns
true if the process suceeded

◆ set_value()

void lampda::physical::fileSystem::user::set_value ( const uint32_t  key,
const uint32_t  value 
)

Store a key/value in the filesystem.

Parameters
[in]keyThe key to store at
[in]valueThe associated value

◆ write_to_file()

void lampda::physical::fileSystem::user::write_to_file ( )

Write the user parameters to a file.

Warning
A failure will erase the system memory