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
21bool has_overflowed();
22
24namespace system {
25
27bool doKeyExists(const uint32_t key);
34bool get_value(const uint32_t key, uint32_t& value);
40void set_value(const uint32_t key, const uint32_t value);
41
50uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect = 0xffffffff);
51
53void clear_cached();
54
59void write_to_file();
60
65bool load_from_file();
66
68bool format();
69
70} // namespace system
71
73namespace user {
74
76bool doKeyExists(const uint32_t key);
83bool get_value(const uint32_t key, uint32_t& value);
89void set_value(const uint32_t key, const uint32_t value);
90
99uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect = 0xffffffff);
100
102void clear_cached();
103
108void write_to_file();
109
114bool load_from_file();
115
117bool format();
118
119} // namespace user
120
121} // namespace filesystem
122} // namespace bsp
123} // namespace lampda
uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect)
Drop all keys using the given bit prefix.
Definition: filesystem.cpp:246
bool load_from_file()
Load system values from memory.
Definition: filesystem.cpp:285
bool get_value(const uint32_t key, uint32_t &value)
Check and return a value stored in a filesystem.
Definition: filesystem.cpp:224
void write_to_file()
Write the system parameters to a file.
Definition: filesystem.cpp:274
void set_value(const uint32_t key, const uint32_t value)
Store a key/value in the filesystem.
Definition: filesystem.cpp:241
bool format()
Delete the system file (Should not be used)
Definition: filesystem.cpp:287
bool doKeyExists(const uint32_t key)
Return true if the given key exists in the filesystem.
Definition: filesystem.cpp:222
void clear_cached()
clear the stored values in the currently loaded file system.
Definition: filesystem.cpp:272
bool format()
Delete the user file.
Definition: filesystem.cpp:372
bool doKeyExists(const uint32_t key)
Return true if the given key exists in the filesystem.
Definition: filesystem.cpp:304
uint32_t dropMatchingKeys(const uint32_t bitMatch, const uint32_t bitSelect)
Drop all keys using the given bit prefix.
Definition: filesystem.cpp:325
void write_to_file()
Write the user parameters to a file.
Definition: filesystem.cpp:357
bool get_value(const uint32_t key, uint32_t &value)
Check and return a value stored in a filesystem.
Definition: filesystem.cpp:306
bool load_from_file()
Load user values from memory.
Definition: filesystem.cpp:370
void set_value(const uint32_t key, const uint32_t value)
Store a key/value in the filesystem.
Definition: filesystem.cpp:323
void clear_cached()
clear the stored values in the currently loaded file system.
Definition: filesystem.cpp:351
void clear_internal_fs()
hard clean of the whole filesystem, you will loose all stored data.
Definition: filesystem.cpp:65
void shutdown()
call once on program stop.
Definition: filesystem.cpp:49
bool has_overflowed()
Return true is the filesystem overflowed at a point. Some parameters may be lost.
Definition: filesystem.cpp:80
Program scope.
Definition: control_fixed_modes.hpp:14