Class TargetDb
Defined in File TargetDb.h
Class Documentation
-
class TargetDb
Manages a database of kernel targets, including both static and dynamically parsed ones.
Public Functions
-
~TargetDb()
-
TargetDb() = default
-
TargetDb(const std::string &filename)
Constructs a TargetDb object.
- Parameters:
filename – A database file to read from.
-
TargetDb(const std::vector<uint8_t> &data)
Constructs a TargetDb object from a byte buffer.
- Parameters:
data – The buffer containing the KXDB file data.
-
TargetDb(const std::string &filename, const std::vector<uint8_t> &fallback_kxdb)
Constructs a TargetDb object.
- Parameters:
filename – A database file to read from if exists.
fallback_kxdb – The buffer containing the fallback / built-in KXDB file data if the file does not exists.
-
void AddTarget(const Target &target)
Adds a target to the database.
- Parameters:
target – The target to add.
-
Target GetTarget(const std::string &distro, const std::string &release_name)
Retrieves a Target object by distro and release name.
- Parameters:
distro – The distribution name.
release_name – The release name.
- Returns:
The Target object.
-
Target GetTarget(const std::string &version)
Retrieves a Target object by version.
- Parameters:
version – The version string.
- Returns:
The Target object.
-
Target AutoDetectTarget()
Automatically detects the target based on the system’s kernel version.
- Throws:
ExpKitError – if the target cannot be detected.
- Returns:
The detected Target object.
-
~TargetDb()