GemaLib
The GeMA library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GmSharedCodeLoaderReadBuffer Class Reference

An auxiliar class to implement a simple form of look ahead while reading file data. More...

Collaboration diagram for GmSharedCodeLoaderReadBuffer:
Collaboration graph
[legend]

Public Member Functions

 GmSharedCodeLoaderReadBuffer (QFile &file, const GmLogCategory &logger)
 Constructor.
 
const QString nextLine ()
 Returns the next file line, keeping it in an internal buffer.
 
QString readLine ()
 Returns the next buffer line, removing it from the buffer, or the next file line (without buffering)
 
QString skipUntilLine (int line)
 Reads and skips file lines until arriving in the given line, returned by the call. Clears the buffer.
 
int pos () const
 Returns the line number of the last line that was read from the file.
 
bool error () const
 Did the last operation ended on error?
 

Private Member Functions

bool onError ()
 Check for end of file.
 

Private Attributes

QFile_file
 The file.
 
const GmLogCategory_logger
 Logger for error messages.
 
bool _error
 Did the last read atempt ended on error?
 
QStringList _buffer
 The buffer.
 
int _filePos
 The line number of the last line that was read from the file.
 

Detailed Description

An auxiliar class to implement a simple form of look ahead while reading file data.


The documentation for this class was generated from the following file: