Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
filesystem.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <cstdint>
8
9namespace lampda {
10namespace bsp {
12namespace filesystem {
13
15void shutdown();
16
19
21namespace system {
22
24bool doKeyExists(const uint32_t key);
31bool get_value(const uint32_t key, uint32_t& value);
37void set_value(const uint32_t key, const uint32_t value);
38
47uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect = 0xffffffff);
48
50void clear_cached();
51
56void write_to_file();
57
62bool load_from_file();
63
65bool format();
66
67} // namespace system
68
70namespace user {
71
73bool doKeyExists(const uint32_t key);
80bool get_value(const uint32_t key, uint32_t& value);
86void set_value(const uint32_t key, const uint32_t value);
87
96uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect = 0xffffffff);
97
99void clear_cached();
100
105void write_to_file();
106
111bool load_from_file();
112
114bool format();
115
116} // namespace user
117
118} // namespace filesystem
119} // namespace bsp
120} // namespace lampda
uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect)
Drop all keys using the given bit prefix.
Definition: filesystem.cpp:212
bool load_from_file()
Load system values from memory.
Definition: filesystem.cpp:251
bool get_value(const uint32_t key, uint32_t &value)
Check and return a value stored in a filesystem.
Definition: filesystem.cpp:193
void write_to_file()
Write the system parameters to a file.
Definition: filesystem.cpp:240
void set_value(const uint32_t key, const uint32_t value)
Store a key/value in the filesystem.
Definition: filesystem.cpp:210
bool format()
Delete the system file (Should not be used)
Definition: filesystem.cpp:253
bool doKeyExists(const uint32_t key)
Return true if the given key exists in the filesystem.
Definition: filesystem.cpp:191
void clear_cached()
clear the stored values in the currently loaded file system.
Definition: filesystem.cpp:238
bool format()
Delete the user file.
Definition: filesystem.cpp:338
bool doKeyExists(const uint32_t key)
Return true if the given key exists in the filesystem.
Definition: filesystem.cpp:270
uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect)
Drop all keys using the given bit prefix.
Definition: filesystem.cpp:291
void write_to_file()
Write the user parameters to a file.
Definition: filesystem.cpp:323
bool get_value(const uint32_t key, uint32_t &value)
Check and return a value stored in a filesystem.
Definition: filesystem.cpp:272
bool load_from_file()
Load user values from memory.
Definition: filesystem.cpp:336
void set_value(const uint32_t key, const uint32_t value)
Store a key/value in the filesystem.
Definition: filesystem.cpp:289
void clear_cached()
clear the stored values in the currently loaded file system.
Definition: filesystem.cpp:317
void clear_internal_fs()
hard clean of the whole filesystem, you will loose all stored data.
Definition: filesystem.cpp:48
void shutdown()
call once on program stop.
Definition: filesystem.cpp:46
Program scope.
Definition: control_fixed_modes.hpp:12