2020-11-21 00:12:58 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/views/view.hpp>
|
2020-11-21 00:12:58 +01:00
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/api/content_registry.hpp>
|
2021-01-13 01:24:27 +01:00
|
|
|
|
2020-11-22 15:32:37 +01:00
|
|
|
#include <bit>
|
2020-11-21 00:12:58 +01:00
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
namespace prv { class Provider; }
|
|
|
|
|
|
|
|
class ViewDataInspector : public View {
|
|
|
|
public:
|
2020-12-27 15:39:06 +01:00
|
|
|
explicit ViewDataInspector();
|
2020-11-21 00:12:58 +01:00
|
|
|
~ViewDataInspector() override;
|
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
void drawContent() override;
|
|
|
|
void drawMenu() override;
|
2020-11-21 00:12:58 +01:00
|
|
|
|
|
|
|
private:
|
2021-03-02 22:09:38 +01:00
|
|
|
struct InspectorCacheEntry {
|
|
|
|
std::string unlocalizedName;
|
|
|
|
ContentRegistry::DataInspector::DisplayFunction displayFunction;
|
|
|
|
};
|
|
|
|
|
2020-11-21 00:12:58 +01:00
|
|
|
bool m_shouldInvalidate = true;
|
|
|
|
|
2021-01-03 17:12:20 +01:00
|
|
|
std::endian m_endian = std::endian::native;
|
2021-01-13 01:24:27 +01:00
|
|
|
ContentRegistry::DataInspector::NumberDisplayStyle m_numberDisplayStyle =ContentRegistry::DataInspector::NumberDisplayStyle::Decimal;
|
2020-11-22 15:32:37 +01:00
|
|
|
|
2021-01-13 01:24:27 +01:00
|
|
|
u64 m_startAddress = 0;
|
2020-11-21 00:12:58 +01:00
|
|
|
size_t m_validBytes = 0;
|
2021-03-02 22:09:38 +01:00
|
|
|
std::vector<InspectorCacheEntry> m_cachedData;
|
2020-11-21 00:12:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|