-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
210 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
SPDX-FileCopyrightText: Lieven Hey <[email protected]> | ||
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected] | ||
SPDX-License-Identifier: GPL-2.0-or-later | ||
*/ | ||
|
||
#include "disassemblyentry.h" | ||
|
||
DisassemblyEntry::DisassemblyEntry(DisassemblyEntry* parent, int row, | ||
const DisassemblyOutput::DisassemblyLine& disassemblyLine, QTextLine textLine) | ||
: m_parent(parent) | ||
, m_disassemblyLine(disassemblyLine) | ||
, m_textLine(textLine) | ||
, m_row(row) | ||
{ | ||
} | ||
|
||
DisassemblyEntry* DisassemblyEntry::lastChild() | ||
{ | ||
if (m_lines.isEmpty()) { | ||
return nullptr; | ||
} | ||
|
||
return &m_lines[m_lines.size() - 1]; | ||
} | ||
|
||
void DisassemblyEntry::addChild(const DisassemblyEntry& line) | ||
{ | ||
m_lines.push_back(line); | ||
} | ||
|
||
void DisassemblyEntry::clear() | ||
{ | ||
m_lines.clear(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
SPDX-FileCopyrightText: Lieven Hey <[email protected]> | ||
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected] | ||
SPDX-License-Identifier: GPL-2.0-or-later | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "disassemblyoutput.h" | ||
#include <QTextLine> | ||
#include <QVector> | ||
|
||
class DisassemblyEntry | ||
{ | ||
public: | ||
DisassemblyEntry(DisassemblyEntry* parent, int row, const DisassemblyOutput::DisassemblyLine& disassemblyLine = {}, | ||
QTextLine textLine = {}); | ||
|
||
~DisassemblyEntry() = default; | ||
|
||
DisassemblyEntry* parent() const | ||
{ | ||
return m_parent; | ||
} | ||
|
||
int row() const | ||
{ | ||
return m_row; | ||
} | ||
|
||
DisassemblyEntry* child(int row) | ||
{ | ||
return &m_lines[row]; | ||
} | ||
|
||
DisassemblyEntry* lastChild(); | ||
|
||
DisassemblyOutput::DisassemblyLine disassemblyLine() const | ||
{ | ||
return m_disassemblyLine; | ||
} | ||
|
||
QTextLine textLine() const | ||
{ | ||
return m_textLine; | ||
} | ||
|
||
int childCount() const | ||
{ | ||
return m_lines.size(); | ||
} | ||
|
||
void clear(); | ||
void addChild(const DisassemblyEntry& line); | ||
|
||
private: | ||
DisassemblyEntry* m_parent; | ||
QVector<DisassemblyEntry> m_lines; | ||
DisassemblyOutput::DisassemblyLine m_disassemblyLine; | ||
QTextLine m_textLine; | ||
int m_row; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters