CrystalSpace

Public API Reference

csStringReader Class Reference

This is a convenience class that reads an input buffer line by line. More...

#include <csutil/stringreader.h>

List of all members.

Public Member Functions

 csStringReader (const char *input)
 Open a new string reader on the given input.
 csStringReader ()
 Create an empty string reader.
bool GetLine (csString &line)
 Get the next line from the input and put it in the string argument.
bool HasMoreLines ()
 Returns true if there are more lines.
void Reset ()
 Reset the reading offset at the start of the input.
void SetInput (const char *input)
 Set input buffer.


Detailed Description

This is a convenience class that reads an input buffer line by line.

It takes care of OS specific line endings (CR or CR/LF).

Definition at line 32 of file stringreader.h.


Constructor & Destructor Documentation

csStringReader::csStringReader (  ) 

Create an empty string reader.

csStringReader::csStringReader ( const char *  input  ) 

Open a new string reader on the given input.

'input' must point to a null terminated character buffer.


Member Function Documentation

bool csStringReader::GetLine ( csString line  ) 

Get the next line from the input and put it in the string argument.

Returns true on success or false if there are no more lines left (the string will be made empty in that case). Note that the returned string will not contain a newline at the end.

bool csStringReader::HasMoreLines (  ) 

Returns true if there are more lines.

void csStringReader::Reset (  ) 

Reset the reading offset at the start of the input.

void csStringReader::SetInput ( const char *  input  ) 

Set input buffer.

'input' must point to a null terminated character buffer.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7