From 0e1a5ce2375db94e6bb05d204b1f6c5165652c1e Mon Sep 17 00:00:00 2001 From: David Korth Date: Mon, 9 Jun 2025 19:26:40 -0400 Subject: [PATCH] [libromdata] ISO::loadFieldData(): Show the AUTORUN.INF fields in a new tab. The fields are displayed as-is. Changed autorun_inf from unordered_map<> to map<> for alphabetical sorting. TODO: Preserve the original sort order? TODO: Store the original key case? --- src/libromdata/Media/ISO.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libromdata/Media/ISO.cpp b/src/libromdata/Media/ISO.cpp index 1ca45dbaf..3b35ad9dc 100644 --- a/src/libromdata/Media/ISO.cpp +++ b/src/libromdata/Media/ISO.cpp @@ -34,9 +34,9 @@ using namespace LibRpTexture; // C++ STL classes using std::array; +using std::map; using std::string; using std::unique_ptr; -using std::unordered_map; using std::vector; namespace LibRomData { @@ -227,7 +227,7 @@ public: // TODO: Concatenate the section and key names. // For now, only handling the "[autorun]" section. // Keys are stored as-is, without concatenation. - unordered_map autorun_inf; + map autorun_inf; /** * ini.h callback for parsing AUTORUN.INF. @@ -726,6 +726,7 @@ int ISOPrivate::parse_autorun_inf(void *user, const char *section, const char *n } // Convert the name to lowercase. + // TODO: Store the original case elsewhere? string s_name = name; std::transform(s_name.begin(), s_name.end(), s_name.begin(), [](char c) noexcept -> char { return std::tolower(c); }); @@ -1327,6 +1328,16 @@ int ISO::loadFieldData(void) d->s_udf_version); } + // AUTORUN.INF + int ret = d->loadAutorunInf(); + if (ret == 0) { + // Add the AUTORUN.INF fields as-is. + d->fields.addTab("AUTORUN.INF"); + for (const auto &pair : d->autorun_inf) { + d->fields.addField_string(pair.first.c_str(), pair.second); + } + } + // Finished reading the field data. return static_cast(d->fields.count()); }