mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 04:52:23 +00:00
HexEditor: Add selection strings to the value inspector
Strings include ASCII, UTF-8, and UTF-16 Co-authored-by: Andreas Krohn <hamburger1984@gmail.com>
This commit is contained in:
parent
815442b2b5
commit
eb27b397b8
Notes:
sideshowbarker
2024-07-17 00:24:20 +09:00
Author: https://github.com/MetallicSquid 🔰
Commit: eb27b397b8
Pull-request: https://github.com/SerenityOS/serenity/pull/16979
Issue: https://github.com/SerenityOS/serenity/issues/13655
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/ebanner
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
5 changed files with 40 additions and 1 deletions
|
@ -245,6 +245,18 @@ Optional<u8> HexEditor::get_byte(size_t position)
|
|||
return {};
|
||||
}
|
||||
|
||||
ByteBuffer HexEditor::get_selected_bytes()
|
||||
{
|
||||
auto num_selected_bytes = m_selection_end - m_selection_start;
|
||||
ByteBuffer data;
|
||||
data.ensure_capacity(num_selected_bytes);
|
||||
|
||||
for (size_t i = m_selection_start; i < m_selection_end; i++)
|
||||
data.append(m_document->get(i).value);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void HexEditor::mousedown_event(GUI::MouseEvent& event)
|
||||
{
|
||||
if (event.button() != GUI::MouseButton::Primary) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue