* 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. */
| 353 | * @return the number of characters inserted. |
| 354 | */ |
| 355 | int 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". |