mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
HexEditor: Show endianness in the value inspector
This commit is contained in:
parent
f4b8bae65f
commit
d20ff6c891
2 changed files with 5 additions and 3 deletions
|
@ -275,7 +275,7 @@ void HexEditorWidget::update_inspector_values(size_t position)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate the model
|
// Populate the model
|
||||||
NonnullRefPtr<ValueInspectorModel> value_inspector_model = make_ref_counted<ValueInspectorModel>();
|
NonnullRefPtr<ValueInspectorModel> value_inspector_model = make_ref_counted<ValueInspectorModel>(m_value_inspector_little_endian);
|
||||||
if (byte_read_count >= 1) {
|
if (byte_read_count >= 1) {
|
||||||
u8 unsigned_byte_value = 0;
|
u8 unsigned_byte_value = 0;
|
||||||
if (m_value_inspector_little_endian)
|
if (m_value_inspector_little_endian)
|
||||||
|
|
|
@ -34,7 +34,8 @@ public:
|
||||||
Value
|
Value
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit ValueInspectorModel()
|
explicit ValueInspectorModel(bool is_little_endian)
|
||||||
|
: m_is_little_endian(is_little_endian)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ValueType::__Count; i++)
|
for (int i = 0; i < ValueType::__Count; i++)
|
||||||
set_parsed_value(static_cast<ValueType>(i), "");
|
set_parsed_value(static_cast<ValueType>(i), "");
|
||||||
|
@ -61,7 +62,7 @@ public:
|
||||||
case Column::Type:
|
case Column::Type:
|
||||||
return "Type";
|
return "Type";
|
||||||
case Column::Value:
|
case Column::Value:
|
||||||
return "Value";
|
return m_is_little_endian ? "Value (Little Endian)" : "Value (Big Endian)";
|
||||||
}
|
}
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
@ -131,5 +132,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool m_is_little_endian = false;
|
||||||
Array<String, ValueType::__Count> m_values = {};
|
Array<String, ValueType::__Count> m_values = {};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue