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

Method preLineWS

astyle/src/ASBeautifier.cpp:1075–1100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073
1074
1075string ASBeautifier::preLineWS(int lineIndentCount, int lineSpaceIndentCount) const
1076{
1077 if (shouldForceTabIndentation)
1078 {
1079 if (tabLength != indentLength)
1080 {
1081 // adjust for different tab length
1082 int indentCountOrig = lineIndentCount;
1083 int spaceIndentCountOrig = lineSpaceIndentCount;
1084 lineIndentCount = ((indentCountOrig * indentLength) + spaceIndentCountOrig) / tabLength;
1085 lineSpaceIndentCount = ((indentCountOrig * indentLength) + spaceIndentCountOrig) % tabLength;
1086 }
1087 else
1088 {
1089 lineIndentCount += lineSpaceIndentCount / indentLength;
1090 lineSpaceIndentCount = lineSpaceIndentCount % indentLength;
1091 }
1092 }
1093
1094 string ws;
1095 for (int i = 0; i < lineIndentCount; i++)
1096 ws += indentString;
1097 while ((lineSpaceIndentCount--) > 0)
1098 ws += string(" ");
1099 return ws;
1100}
1101
1102/**
1103 * register an in-statement indent.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected