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

Function FindAddressAndIndentationTokens

basicblock.cpp:238–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236
237
238static void FindAddressAndIndentationTokens(
239 const vector<InstructionTextToken>& tokens, const std::function<void(const InstructionTextToken&)>& callback)
240{
241 size_t startToken = 0;
242 for (size_t i = 0; i < tokens.size(); i++)
243 {
244 if (tokens[i].type == AddressSeparatorToken)
245 {
246 startToken = i + 1;
247 break;
248 }
249 }
250
251 for (size_t i = 0; i < startToken; i++)
252 callback(tokens[i]);
253 for (size_t i = startToken; i < tokens.size(); i++)
254 {
255 if (tokens[i].type == AddressDisplayToken || tokens[i].type == AddressSeparatorToken
256 || tokens[i].type == CollapseStateIndicatorToken)
257 {
258 callback(tokens[i]);
259 continue;
260 }
261
262 bool whitespace = true;
263 for (auto ch : tokens[i].text)
264 {
265 if (!isspace(ch))
266 {
267 whitespace = false;
268 break;
269 }
270 }
271
272 if (!whitespace)
273 break;
274
275 callback(tokens[i]);
276 }
277}
278
279
280size_t DisassemblyTextLine::GetAddressAndIndentationWidth() const

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected