MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / performSort

Method performSort

examples/triage/entry.cpp:102–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102void GenericEntryModel::performSort(int col, Qt::SortOrder order)
103{
104 std::sort(m_entries.begin(), m_entries.end(), [&](FunctionRef a, FunctionRef b) {
105 if (col == AddressColumn)
106 {
107 if (a->GetStart() != b->GetStart())
108 {
109 if (order == Qt::AscendingOrder)
110 return a->GetStart() < b->GetStart();
111 else
112 return a->GetStart() > b->GetStart();
113 }
114 if (order == Qt::AscendingOrder)
115 return a->GetSymbol()->GetFullName() < b->GetSymbol()->GetFullName();
116 else
117 return a->GetSymbol()->GetFullName() > b->GetSymbol()->GetFullName();
118 }
119 else if (col == NameColumn)
120 {
121 if (order == Qt::AscendingOrder)
122 return a->GetSymbol()->GetFullName() < b->GetSymbol()->GetFullName();
123 else
124 return a->GetSymbol()->GetFullName() > b->GetSymbol()->GetFullName();
125 }
126 return false;
127 });
128}
129
130
131void GenericEntryModel::sort(int col, Qt::SortOrder order)

Callers

nothing calls this directly

Calls 5

GetFullNameMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetStartMethod · 0.45
GetSymbolMethod · 0.45

Tested by

no test coverage detected