From c4b1dd712783e7474570705e6d95183a0c02a76e Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 5 Feb 2021 20:28:13 +0800 Subject: add persistent search result --- ui/getsymbolslistthread.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ui/getsymbolslistthread.h (limited to 'ui/getsymbolslistthread.h') diff --git a/ui/getsymbolslistthread.h b/ui/getsymbolslistthread.h new file mode 100644 index 00000000..b806448a --- /dev/null +++ b/ui/getsymbolslistthread.h @@ -0,0 +1,37 @@ +#pragma once + +#ifndef BINARYNINJAUI_BINDINGS +#include +#include +#endif +#include "binaryninjaapi.h" +#include "uitypes.h" + + +#ifdef BINARYNINJAUI_BINDINGS +// QThread has issues working in the bindings on some platforms +class GetSymbolsListThread; +#else +class BINARYNINJAUIAPI GetSymbolsListThread: public QThread +{ + Q_OBJECT + + QStringList m_allSymbols; + std::function m_completeFunc; + std::mutex m_mutex; + bool m_done; + BinaryViewRef m_view; + +protected: + virtual void run() override; + +public: + GetSymbolsListThread(BinaryViewRef view, const std::function& completeFunc); + void cancel(); + + static int m_eventType; + int GetEventType() { return GetSymbolsListThread::m_eventType; } + + const QStringList& getSymbols() const { return m_allSymbols; } +}; +#endif -- cgit v1.3.1