2020-11-15 01:42:43 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2020-11-15 01:42:43 +01:00
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
|
2021-12-07 22:47:41 +01:00
|
|
|
namespace hex::plugin::builtin {
|
2020-11-15 01:42:43 +01:00
|
|
|
|
|
|
|
struct FoundString {
|
|
|
|
u64 offset;
|
|
|
|
size_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ViewStrings : public View {
|
|
|
|
public:
|
2020-12-27 15:39:06 +01:00
|
|
|
explicit ViewStrings();
|
2020-11-15 01:42:43 +01:00
|
|
|
~ViewStrings() override;
|
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
void drawContent() override;
|
2020-11-15 01:42:43 +01:00
|
|
|
|
|
|
|
private:
|
2022-02-01 22:09:44 +01:00
|
|
|
bool m_searching = false;
|
|
|
|
bool m_regex = false;
|
2022-03-25 21:08:38 +01:00
|
|
|
bool m_pattern_parsed = true;
|
2020-11-15 01:42:43 +01:00
|
|
|
|
|
|
|
std::vector<FoundString> m_foundStrings;
|
2021-09-06 22:45:55 +02:00
|
|
|
std::vector<size_t> m_filterIndices;
|
2020-11-15 01:42:43 +01:00
|
|
|
int m_minimumLength = 5;
|
2021-09-06 22:45:55 +02:00
|
|
|
std::string m_filter;
|
2020-11-24 18:12:08 +01:00
|
|
|
|
|
|
|
std::string m_selectedString;
|
|
|
|
std::string m_demangledName;
|
|
|
|
|
2021-02-22 10:16:58 +01:00
|
|
|
void searchStrings();
|
2020-11-24 18:12:08 +01:00
|
|
|
void createStringContextMenu(const FoundString &foundString);
|
2020-11-15 01:42:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|