1
0
mirror of synced 2024-12-16 01:31:16 +01:00
ImHex/plugins/builtin/source/content/tools/demangler.cpp
iTrooz 39252dfe48
refactor: Move custom ImGui functions to ImGuiExt namespace (#1427)
Co-authored-by: Nik <werwolv98@gmail.com>
2023-11-16 22:24:06 +01:00

31 lines
935 B
C++

#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 = "???";
}
}
ImGuiExt::Header("hex.builtin.tools.demangler.demangled"_lang);
if (ImGui::BeginChild("demangled", ImVec2(0, 200_scaled), true)) {
ImGuiExt::TextFormattedWrappedSelectable("{}", demangledName);
}
ImGui::EndChild();
}
}
}