Logo Search packages:      
Sourcecode: scummvm version File versions

String Common::SeekableReadStream::readLine (  )  [virtual, inherited]

Reads a full line and returns it as a Common::String. Reading stops when the end of a line is reached (CR, CR/LF or LF), and at end-of-file or error.

Upon successful completion, return a string with the content of the line, *without* the end of a line marker. This method does not indicate whether an error occured. Callers muse use ioFailed() or eos() to determine whether an exception occurred.

Definition at line 160 of file stream.cpp.

References Common::String::deleteLastChar(), Common::String::lastChar(), and Common::SeekableReadStream::readLine_NEW().

      // Read a line
      String line;
      while (line.lastChar() != '\n') {
            char buf[256];
            if (!readLine_NEW(buf, 256))
            line += buf;

      if (line.lastChar() == '\n')

      return line;

Generated by  Doxygen 1.6.0   Back to index