Main   Class Hierarchy   Classes   Compound List   Files   Compound Members   File Members   Pages  

PathFind::LineReader Class Reference

#include <util.h>

List of all members.


Detailed Description

Wrapper class around std::istream for reading line by line.

Allows keeping track of the line number for generating meaningful error messages.

Definition at line 34 of file util.h.

Public Member Functions

 LineReader (std::istream &in)
Error createError (const string &message)
 Creates a new error with a message and the current line number.

int getLineNumber ()
std::string readLine ()
 Read next line.


Static Public Attributes

const int MAX_LINE = 2048

Private Attributes

int m_lineNumber
std::istream & m_in


Constructor & Destructor Documentation

LineReader::LineReader std::istream &  in  ) 
 

Definition at line 28 of file util.cpp.


Member Function Documentation

Error LineReader::createError const string &  message  ) 
 

Creates a new error with a message and the current line number.

Definition at line 34 of file util.cpp.

References m_lineNumber.

Referenced by PathFind::Tiling::readObstacles(), and PathFind::Tiling::Tiling().

int PathFind::LineReader::getLineNumber  )  [inline]
 

Definition at line 44 of file util.h.

References m_lineNumber.

std::string LineReader::readLine  ) 
 

Read next line.

Exceptions:
ReadError Reading failed.

Definition at line 41 of file util.cpp.

References m_in, m_lineNumber, and MAX_LINE.

Referenced by PathFind::Tiling::readObstacles(), and PathFind::Tiling::Tiling().


Member Data Documentation

std::istream& PathFind::LineReader::m_in [private]
 

Definition at line 57 of file util.h.

Referenced by readLine().

int PathFind::LineReader::m_lineNumber [private]
 

Definition at line 55 of file util.h.

Referenced by createError(), getLineNumber(), and readLine().

const int PathFind::LineReader::MAX_LINE = 2048 [static]
 

Definition at line 37 of file util.h.

Referenced by readLine().


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


Generated on Thu Aug 7 13:05:24 2003 by Doxygen1.3.1