MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / indentLine

Method indentLine

other_src/astyle/src/ASEnhancer.cpp:355–375  ·  view source on GitHub ↗

* indent a line by a given number of tabsets * by inserting leading whitespace to the line argument. * * @param line a reference to the line to indent. * @param unindent the number of tabsets to insert. * @return the number of characters inserted. */

Source from the content-addressed store, hash-verified

353 * @return the number of characters inserted.
354 */
355int ASEnhancer::indentLine(string& line, int indent) const
356{
357 if (line.length() == 0
358 && ! emptyLineFill)
359 return 0;
360
361 size_t charsToInsert;
362
363 if (useTabs)
364 {
365 charsToInsert = indent;
366 line.insert(0U, charsToInsert, '\t');
367 }
368 else
369 {
370 charsToInsert = indent * indentLength;
371 line.insert(0U, charsToInsert, ' ');
372 }
373
374 return charsToInsert;
375}
376
377/**
378 * check for SQL "BEGIN DECLARE SECTION".

Callers

nothing calls this directly

Calls 2

lengthMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected