From 37c81df21ca54b10092384587225d23eb0ebc7cd Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 3 Apr 2016 20:45:44 -0400 Subject: [PATCH] Add reverse vtable name lookup --- library/include/VersionInfo.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/include/VersionInfo.h b/library/include/VersionInfo.h index 26aee19d1..cf7dd60c0 100644 --- a/library/include/VersionInfo.h +++ b/library/include/VersionInfo.h @@ -148,6 +148,18 @@ namespace DFHack return 0; return (void*)i->second; } + bool getVTableName (const void *vtable, std::string &out) const + { + for (auto i = VTables.begin(); i != VTables.end(); ++i) + { + if ((void*)i->second == vtable) + { + out = i->first; + return true; + } + } + return false; + } void setOS(const OSType os) {