|
FlatImage
A configurable Linux containerization system
|
Bind mount configuration management. More...
Classes | |
| struct | Bind |
| Represents a single bind mount from host to guest. More... | |
| struct | Binds |
| Container for multiple bind mount configurations. More... | |
Functions | |
| ENUM (Type, RO, RW, DEV) | |
| Value< Binds > | deserialize (std::string_view raw_json) |
| Deserializes JSON string into a Binds object. | |
| Value< Binds > | deserialize (std::ifstream &stream_raw_json) noexcept |
| Deserializes JSON from an input stream into a Binds object. | |
| Value< Db > | serialize (Binds const &binds) noexcept |
| Serializes a Binds object into a JSON database. | |
Bind mount configuration management.
Manages host-to-sandbox bind mount configurations with support for read-only (RO), read-write (RW), and device (DEV) mount types. Provides serialization/deserialization to JSON, mount indexing, and collection management for configuring filesystem bindings between the host system and sandboxed container.
|
inlinenodiscardnoexcept |
Deserializes JSON from an input stream into a Binds object.
Reads the entire contents of the input file stream into a string buffer and delegates to the string_view overload of deserialize() for parsing. This provides a convenient interface for reading bind configurations directly from file streams without manual buffer management.
| stream_raw_json | Input file stream containing JSON bind mount data |
Definition at line 226 of file bind.hpp.
Deserializes JSON string into a Binds object.
Parses a JSON string containing bind mount configurations and constructs a Binds object. Each JSON entry should have "src", "dst", and "type" fields. The type field must be "ro" (read-only), "rw" (read-write), or "dev" (device). Entries with invalid indices are logged as warnings and skipped. Successfully parsed entries are added to the Binds collection with their respective indices, source paths, destination paths, and access types.
| raw_json | The JSON string containing bind mount configurations |
Definition at line 184 of file bind.hpp.
Serializes a Binds object into a JSON database.
Converts the Binds collection into a structured Db (JSON) object. Each bind mount is stored as a numbered entry with its index as the key. Each entry contains three fields: "src" (source path), "dst" (destination path), and "type" (access mode as "ro", "rw", or "dev"). The resulting Db can be dumped to a string or written to a file.
| binds | The Binds object containing bind mount configurations to serialize |
Definition at line 244 of file bind.hpp.