MCPcopy Create free account
hub / github.com/dirkvranckaert/AndroidDecompiler / convertTabToSpaces

Method convertTabToSpaces

astyle/src/ASFormatter.cpp:4497–4509  ·  view source on GitHub ↗

* convert a tab to spaces. * charNum points to the current character to convert to spaces. * tabIncrementIn is the increment that must be added for tab indent characters * to get the correct column for the current tab. * replaces the tab in currentLine with the required number of spaces. * replaces the value of currentChar. */

Source from the content-addressed store, hash-verified

4495 * replaces the value of currentChar.
4496 */
4497void ASFormatter::convertTabToSpaces()
4498{
4499 assert(currentLine[charNum] == '\t');
4500
4501 // do NOT replace if in quotes
4502 if (isInQuote || isInQuoteContinuation)
4503 return;
4504
4505 size_t tabSize = getTabLength();
4506 size_t numSpaces = tabSize - ((tabIncrementIn + charNum) % tabSize);
4507 currentLine.replace(charNum, 1, numSpaces, ' ');
4508 currentChar = currentLine[charNum];
4509}
4510
4511/**
4512* is it ok to break this block?

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected