MCPcopy Create free account
hub / github.com/KDE/kdevelop / nextLine

Method nextLine

plugins/astyle/3rdparty/libastyle/ASFormatter.cpp:463–1926  ·  view source on GitHub ↗

* get the next formatted line. * * @return formatted line. */

Source from the content-addressed store, hash-verified

461 * @return formatted line.
462 */
463string ASFormatter::nextLine()
464{
465 const string* newHeader = nullptr;
466 isInVirginLine = isVirgin;
467 isCharImmediatelyPostComment = false;
468 isPreviousCharPostComment = false;
469 isCharImmediatelyPostLineComment = false;
470 isCharImmediatelyPostOpenBlock = false;
471 isCharImmediatelyPostCloseBlock = false;
472 isCharImmediatelyPostTemplate = false;
473
474 while (!isLineReady)
475 {
476 if (shouldReparseCurrentChar)
477 shouldReparseCurrentChar = false;
478 else if (!getNextChar())
479 {
480 breakLine();
481 continue;
482 }
483 else // stuff to do when reading a new character...
484 {
485 // make sure that a virgin '{' at the beginning of the file will be treated as a block...
486 if (isInVirginLine && currentChar == '{'
487 && currentLineBeginsWithBrace
488 && previousCommandChar == ' ')
489 previousCommandChar = '{';
490 if (isInClassInitializer
491 && isBraceType(braceTypeStack->back(), COMMAND_TYPE))
492 isInClassInitializer = false;
493 if (isInBraceRunIn)
494 isInLineBreak = false;
495 if (!isWhiteSpace(currentChar))
496 isInBraceRunIn = false;
497 isPreviousCharPostComment = isCharImmediatelyPostComment;
498 isCharImmediatelyPostComment = false;
499 isCharImmediatelyPostTemplate = false;
500 isCharImmediatelyPostReturn = false;
501 isCharImmediatelyPostThrow = false;
502 isCharImmediatelyPostNewDelete = false;
503 isCharImmediatelyPostOperator = false;
504 isCharImmediatelyPostPointerOrReference = false;
505 isCharImmediatelyPostOpenBlock = false;
506 isCharImmediatelyPostCloseBlock = false;
507 }
508
509 if ((lineIsLineCommentOnly || lineIsCommentOnly)
510 && currentLine.find("*INDENT-ON*", charNum) != string::npos
511 && isFormattingModeOff)
512 {
513 isFormattingModeOff = false;
514 breakLine();
515 formattedLine = currentLine;
516 charNum = (int) currentLine.length() - 1;
517 continue;
518 }
519 if (isFormattingModeOff)
520 {

Callers 1

getNextLineMethod · 0.45

Calls 15

tellgMethod · 0.80
substrMethod · 0.80
emptyMethod · 0.80
enhanceMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
backMethod · 0.45
findMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45
compareMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected