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

Method performSort

examples/triage/exports.cpp:164–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163
164void GenericExportsModel::performSort(int col, Qt::SortOrder order)
165{
166 std::sort(m_entries.begin(), m_entries.end(), [&](SymbolRef a, SymbolRef b) {
167 if (col == AddressColumn)
168 {
169 if (a->GetAddress() != b->GetAddress())
170 {
171 if (order == Qt::AscendingOrder)
172 return a->GetAddress() < b->GetAddress();
173 else
174 return a->GetAddress() > b->GetAddress();
175 }
176 if (order == Qt::AscendingOrder)
177 return a->GetFullName() < b->GetFullName();
178 else
179 return a->GetFullName() > b->GetFullName();
180 }
181 else if (col == NameColumn)
182 {
183 if (order == Qt::AscendingOrder)
184 return a->GetFullName() < b->GetFullName();
185 else
186 return a->GetFullName() > b->GetFullName();
187 }
188 else if (col == OrdinalColumn)
189 {
190 if (a->GetOrdinal() != b->GetOrdinal())
191 {
192 if (order == Qt::AscendingOrder)
193 return a->GetOrdinal() < b->GetOrdinal();
194 else
195 return a->GetOrdinal() > b->GetOrdinal();
196 }
197 if (a->GetAddress() != b->GetAddress())
198 {
199 if (order == Qt::AscendingOrder)
200 return a->GetAddress() < b->GetAddress();
201 else
202 return a->GetAddress() > b->GetAddress();
203 }
204 if (order == Qt::AscendingOrder)
205 return a->GetFullName() < b->GetFullName();
206 else
207 return a->GetFullName() > b->GetFullName();
208 }
209 return false;
210 });
211}
212
213
214void GenericExportsModel::sort(int col, Qt::SortOrder order)

Callers

nothing calls this directly

Calls 5

GetFullNameMethod · 0.80
GetOrdinalMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetAddressMethod · 0.45

Tested by

no test coverage detected