mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
Added data inspector to content registry
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <helpers/content_registry.hpp>
|
||||
|
||||
#include <bit>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
@@ -18,43 +20,6 @@ namespace hex {
|
||||
u8 data4[8];
|
||||
};
|
||||
|
||||
union PreviewData {
|
||||
u8 unsigned8;
|
||||
s8 signed8;
|
||||
u16 unsigned16;
|
||||
s16 signed16;
|
||||
u32 unsigned32;
|
||||
s32 signed32;
|
||||
u64 unsigned64;
|
||||
s64 signed64;
|
||||
char8_t ansiChar;
|
||||
char16_t wideChar;
|
||||
u8 utf8Char[4];
|
||||
float float32;
|
||||
double float64;
|
||||
#if defined(OS_WINDOWS) && defined(ARCH_64_BIT)
|
||||
__time32_t time32;
|
||||
__time64_t time64;
|
||||
#else
|
||||
time_t time;
|
||||
#endif
|
||||
GUID guid;
|
||||
};
|
||||
|
||||
struct CachedData {
|
||||
CachedData(std::string name, std::string value, size_t size) : name(name), value(value), size(size) { }
|
||||
|
||||
std::string name;
|
||||
std::string value;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
enum class NumberDisplayStyle {
|
||||
Decimal,
|
||||
Hexadecimal,
|
||||
Octal
|
||||
};
|
||||
|
||||
class ViewDataInspector : public View {
|
||||
public:
|
||||
explicit ViewDataInspector();
|
||||
@@ -67,11 +32,11 @@ namespace hex {
|
||||
bool m_shouldInvalidate = true;
|
||||
|
||||
std::endian m_endian = std::endian::native;
|
||||
NumberDisplayStyle m_numberDisplayStyle = NumberDisplayStyle::Decimal;
|
||||
ContentRegistry::DataInspector::NumberDisplayStyle m_numberDisplayStyle =ContentRegistry::DataInspector::NumberDisplayStyle::Decimal;
|
||||
|
||||
PreviewData m_previewData = { 0 };
|
||||
u64 m_startAddress = 0;
|
||||
size_t m_validBytes = 0;
|
||||
std::vector<CachedData> m_cachedData;
|
||||
std::vector<std::pair<std::string, ContentRegistry::DataInspector::DisplayFunction>> m_cachedData;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user