mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
feat: Added ability to query provider information from pattern language
This commit is contained in:
@@ -262,7 +262,7 @@ namespace hex::plugin::builtin {
|
||||
return hex::toUTF8String(this->m_path);
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> DiskProvider::getDataInformation() const {
|
||||
std::vector<std::pair<std::string, std::string>> DiskProvider::getDataDescription() const {
|
||||
return {
|
||||
{ "hex.builtin.provider.disk.selected_disk"_lang, hex::toUTF8String(this->m_path) },
|
||||
{ "hex.builtin.provider.disk.disk_size"_lang, hex::toByteString(this->m_diskSize) },
|
||||
@@ -363,4 +363,13 @@ namespace hex::plugin::builtin {
|
||||
return { Region::Invalid(), false };
|
||||
}
|
||||
|
||||
std::variant<std::string, i128> DiskProvider::queryInformation(const std::string &category, const std::string &argument) {
|
||||
if (category == "file_path")
|
||||
return hex::toUTF8String(this->m_path);
|
||||
else if (category == "sector_size")
|
||||
return this->m_sectorSize;
|
||||
else
|
||||
return Provider::queryInformation(category, argument);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user