mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
refactor: refactor tools_entries.cpp into several smaller files (#1418)
This commit is contained in:
30
plugins/builtin/source/content/tools/demangler.cpp
Normal file
30
plugins/builtin/source/content/tools/demangler.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/api/localization.hpp>
|
||||
|
||||
#include <llvm/Demangle/Demangle.h>
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
namespace impl {
|
||||
void drawDemangler() {
|
||||
static std::string mangledName, demangledName;
|
||||
|
||||
if (ImGui::InputTextWithHint("hex.builtin.tools.demangler.mangled"_lang, "Itanium, MSVC, Dlang & Rust", mangledName)) {
|
||||
demangledName = llvm::demangle(mangledName);
|
||||
|
||||
if (demangledName == mangledName) {
|
||||
demangledName = "???";
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Header("hex.builtin.tools.demangler.demangled"_lang);
|
||||
if (ImGui::BeginChild("demangled", ImVec2(0, 200_scaled), true)) {
|
||||
ImGui::TextFormattedWrappedSelectable("{}", demangledName);
|
||||
}
|
||||
ImGui::EndChild();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user