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

Function trim_lines

arch/powerpc/assembler.cpp:2670–2691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2668}
2669
2670int trim_lines(vector<string> &lines)
2671{
2672 vector<string> filtered;
2673
2674 for(size_t i=0; i<lines.size(); ++i) {
2675 const char *p = lines[i].c_str();
2676 int left = 0, right = (int)lines[i].size()-1;
2677
2678 while(isspace(p[left]))
2679 left += 1;
2680
2681 while(right>=0 && isspace(p[right]))
2682 right -= 1;
2683
2684 if(right >= left)
2685 filtered.push_back(string(p, left, right-left+1));
2686 }
2687
2688 lines = filtered;
2689
2690 return 0;
2691}
2692
2693// \S - one or more spaces
2694// \s - zero or more spaces

Callers 1

assemble_multilineFunction · 0.85

Calls 3

c_strMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected