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