Logo Search packages:      
Sourcecode: highlight version File versions  Download package

bool highlight::CodeGenerator::readNewLine ( string &  newLine  )  [private]

read new line from in stream

Definition at line 347 of file codegenerator.cpp.

References formatter, formattingEnabled, formattingPossible, in, lineIndex, lineNumber, maxLineCnt, and terminatingChar.

Referenced by getInputChar().

      {

            bool eof;
            if ( lineIndex ) terminatingChar=newLine[lineIndex-1];
            if ( formattingPossible && formattingEnabled )
            {
                  eof=!formatter->hasMoreLines();
                  if ( !eof )
                  {
                        newLine = formatter->nextLine();
                  }
            }
            // reformatting not enabled
            else
            {
#ifdef __APPLE__
                  eof = ! getline ( *in, newLine, '\r' ); // MacOS
#else
                  eof = ! getline ( *in, newLine );        // other OS
#endif
            }

            return eof || ( lineNumber == maxLineCnt );
      }


Generated by  Doxygen 1.6.0   Back to index