PixelLightAPI  .
Public Member Functions | Protected Member Functions
PLCore::BufferedReader Class Reference

Abstract buffered reader base class. More...

#include <BufferedReader.h>

Inheritance diagram for PLCore::BufferedReader:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~BufferedReader ()
 Destructor.
virtual void Close ()=0
 Closes the reader.
virtual bool IsEof () const =0
 Check if the end of the stream has been reached.
virtual String::EFormat GetStringFormat () const =0
 Returns the string encoding format to use when dealing with string functions.
virtual int GetChar ()=0
 Returns a character read at the current position.
virtual String GetString (uint32 nSize)=0
 Returns a string of a given size read at the current position.
virtual int ReadChar ()=0
 Reads a character at the current position and moves to the position after that.
virtual String ReadString (uint32 nSize)=0
 Reads a string at the current position and moves to the position after that.
virtual bool IsString (const String &sString)=0
 Checks if the next string equals the given one (case sensitive)
virtual bool IsStringNoCase (const String &sString)=0
 Checks if the next string equals the given one (not case sensitive)
virtual uint32 Tell () const =0
 Returns the current position.
virtual bool Seek (uint32 nPos)=0
 Set the current position.

Protected Member Functions

 BufferedReader ()
 Constructor.
PLCORE_API BufferedReader (const BufferedReader &cSource)
 Copy constructor.
PLCORE_API BufferedReaderoperator= (const BufferedReader &cSource)
 Copy operator.

Detailed Description

Abstract buffered reader base class.

Remarks:
A buffered reader is used to access a buffer or stream directly without the need to seek within the stream too often. Therefore the reader stores the read data inside a buffer until it is no longer needed.

Constructor & Destructor Documentation

virtual PLCore::BufferedReader::~BufferedReader ( ) [inline, virtual]

Destructor.

PLCore::BufferedReader::BufferedReader ( ) [inline, protected]
PLCORE_API PLCore::BufferedReader::BufferedReader ( const BufferedReader cSource) [inline, protected]

Copy constructor.

Parameters:
[in]cSourceSource to copy from

Member Function Documentation

virtual void PLCore::BufferedReader::Close ( ) [pure virtual]

Closes the reader.

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual bool PLCore::BufferedReader::IsEof ( ) const [pure virtual]

Check if the end of the stream has been reached.

Returns:
'true' if the end of the buffer has been reached

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual String::EFormat PLCore::BufferedReader::GetStringFormat ( ) const [pure virtual]

Returns the string encoding format to use when dealing with string functions.

Returns:
String encoding format to use when dealing with string functions

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual int PLCore::BufferedReader::GetChar ( ) [pure virtual]

Returns a character read at the current position.

Returns:
Character that has been read, '\0' on error

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual String PLCore::BufferedReader::GetString ( uint32  nSize) [pure virtual]

Returns a string of a given size read at the current position.

Parameters:
[in]nSizeNumber of characters to read
Returns:
String that has been read, "" on error

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual int PLCore::BufferedReader::ReadChar ( ) [pure virtual]

Reads a character at the current position and moves to the position after that.

Returns:
Character that has been read, '\0' on error

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual String PLCore::BufferedReader::ReadString ( uint32  nSize) [pure virtual]

Reads a string at the current position and moves to the position after that.

Parameters:
[in]nSizeNumber of characters to read
Returns:
String that has been read, "" on error

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual bool PLCore::BufferedReader::IsString ( const String sString) [pure virtual]

Checks if the next string equals the given one (case sensitive)

Parameters:
[in]sStringString to compare with (length of this string is used to compare)
Returns:
'true' if the next string equals the given one, else 'false'

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual bool PLCore::BufferedReader::IsStringNoCase ( const String sString) [pure virtual]

Checks if the next string equals the given one (not case sensitive)

Parameters:
[in]sStringString to compare with (length of this string is used to compare)
Returns:
'true' if the next string equals the given one, else 'false'

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual uint32 PLCore::BufferedReader::Tell ( ) const [pure virtual]

Returns the current position.

Returns:
Current position

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

virtual bool PLCore::BufferedReader::Seek ( uint32  nPos) [pure virtual]

Set the current position.

Parameters:
[in]nPosNew position
Returns:
'true' if the seek has been successful

Implemented in PLCore::BufferedReaderFile, and PLCore::BufferedReaderString.

PLCORE_API BufferedReader& PLCore::BufferedReader::operator= ( const BufferedReader cSource) [inline, protected]

Copy operator.

Parameters:
[in]cSourceSource to copy from
Returns:
Reference to this instance

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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:27
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported