CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
PluginStorage.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <cstdint>
13#include <cstddef>
14#include <vector>
15#include <string>
16
17namespace cdc::plugin_manager {
18
20public:
25 static bool mount();
26
30 static void unmount();
31
35 static const char* basePath();
36
41 static std::vector<std::string> listPluginIds();
42
47 static std::string binaryPath(const std::string& id);
48
52 static std::string wasmPath(const std::string& id);
53
57 static std::string aotPath(const std::string& id);
58
62 static std::string metaPath(const std::string& id);
63
67 static std::string langPath(const std::string& id);
68
72 static std::string disabledPath(const std::string& id);
73
77 static bool isDisabled(const std::string& id);
78
82 static bool setDisabled(const std::string& id, bool disabled);
83
87 static bool stats(uint64_t& free_bytes, uint64_t& total_bytes);
88};
89
90} // namespace cdc::plugin_manager
static bool mount()
Mount the plugins partition. Auto-formats if empty.
static const char * basePath()
Returns the VFS path prefix, e.g. "/plugins".
static std::string langPath(const std::string &id)
Returns the full VFS path of <id>.lang (translation overlay).
static void unmount()
Unmount the plugins partition (rarely used; mostly tests).
static std::string aotPath(const std::string &id)
Returns the full VFS path of <id>.aot.
static bool stats(uint64_t &free_bytes, uint64_t &total_bytes)
Returns the free and total bytes on the plugins partition.
static bool isDisabled(const std::string &id)
True when the plugin has a persistent disabled marker.
static bool setDisabled(const std::string &id, bool disabled)
Create or remove the persistent disabled marker for a plugin.
static std::string disabledPath(const std::string &id)
Returns the full VFS path of <id>.disabled.
static std::vector< std::string > listPluginIds()
Discover all installed plugin ids. A plugin is recognised by the presence of both <id>....
static std::string wasmPath(const std::string &id)
Returns the full VFS path of <id>.wasm.
static std::string metaPath(const std::string &id)
Returns the full VFS path of <id>.meta.
static std::string binaryPath(const std::string &id)
Returns the path that should be loaded for <id>: <id>.aot if it exists on disk, otherwise <id>....