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

Method performSort

examples/triage/imports.cpp:152–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150
151
152void GenericImportsModel::performSort(int col, Qt::SortOrder order)
153{
154 std::sort(m_entries.begin(), m_entries.end(), [&](SymbolRef a, SymbolRef b) {
155 if (col == 0)
156 {
157 if (order == Qt::AscendingOrder)
158 return a->GetAddress() < b->GetAddress();
159 else
160 return a->GetAddress() > b->GetAddress();
161 }
162 else if (col == m_nameCol)
163 {
164 if (order == Qt::AscendingOrder)
165 return a->GetFullName() < b->GetFullName();
166 else
167 return a->GetFullName() > b->GetFullName();
168 }
169 else if (col == m_moduleCol)
170 {
171 if (order == Qt::AscendingOrder)
172 return getNamespace(a) < getNamespace(b);
173 else
174 return getNamespace(a) > getNamespace(b);
175 }
176 else if (col == m_ordinalCol)
177 {
178 if (order == Qt::AscendingOrder)
179 return a->GetOrdinal() < b->GetOrdinal();
180 else
181 return a->GetOrdinal() > b->GetOrdinal();
182 }
183 else if (col == m_typeLibCol)
184 {
185 if (order == Qt::AscendingOrder)
186 return getLibrarySource(a) < getLibrarySource(b);
187 else
188 return getLibrarySource(a) > getLibrarySource(b);
189 }
190 return false;
191 });
192}
193
194
195void GenericImportsModel::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