Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUIStreamReaderXML Class Reference

Reads streaming files written by CGUIStreamWriterXML. More...

#include <GUIStreamReaderXML.h>

Inheritance diagram for CGUIStreamReaderXML:

Public Member Functions

virtual CGUIStreamReaderClone () const
 
virtual void DeleteCommentTag (const eC_Char *pcTag=NULL)
 
virtual void DeleteCommentTag (const eC_String &kString)
 
virtual const eC_String & GetFileSuffix () const
 
virtual void ReadBinary (eC_TArray< eC_UByte > &aData, const eC_Char *pcTag=NULL)
 
virtual eC_Bool ReadBool (const eC_Char *pcTag=NULL)
 
virtual eC_Byte ReadByte (const eC_Char *pcTag=NULL)
 
virtual ColorValue_t ReadColor (const eC_Char *pcTag=NULL)
 
virtual eC_Float ReadFloat (const eC_Char *pcTag=NULL)
 
virtual eC_UInt ReadHex (const eC_Char *pcTag=NULL)
 
virtual eC_Int ReadInt (const eC_Char *pcTag=NULL)
 
virtual eC_Short ReadShort (const eC_Char *pcTag=NULL)
 
virtual eC_Int ReadStreamingFileHeader ()
 
virtual eC_String ReadString (const eC_Char *pcTag=NULL)
 
virtual eC_UByte ReadUByte (const eC_Char *pcTag=NULL)
 
virtual eC_UInt ReadUInt (const eC_Char *pcTag=NULL)
 
virtual eC_UShort ReadUShort (const eC_Char *pcTag=NULL)
 
- Public Member Functions inherited from CGUIStreamReader
virtual ~CGUIStreamReader ()
 
virtual CGUIStreamReaderClone () const =0
 
virtual void DeleteCommentTag (const eC_Char *pcTag=NULL)=0
 
virtual void DeleteCommentTag (const eC_String &kTag)=0
 
eC_UInt GetCurLine () const
 
FileAlignment_t GetFileAlignment () const
 
FileEndianess_t GetFileEndianess () const
 
virtual const eC_String & GetFileSuffix () const
 
FileType_t GetFileType () const
 
eC_String GetLastReadTag () const
 
virtual AnimationHandle_t ReadAnimationChainID (const eC_Char *pcTag=NULL)
 
virtual void ReadBinary (eC_TArray< eC_UByte > &aData, const eC_Char *pcTag=NULL)=0
 
virtual eC_Bool ReadBool (const eC_Char *pcTag=NULL)=0
 
virtual eC_Byte ReadByte (const eC_Char *pcTag=NULL)=0
 
virtual ColorValue_t ReadColor (const eC_Char *pcTag=NULL)=0
 
virtual DataPoolResource_t ReadDataPoolID (const eC_Char *pcTag=NULL)
 
virtual eC_Float ReadFloat (const eC_Char *pcTag=NULL)=0
 
virtual FontResource_t ReadFontID (const eC_Char *pcTag=NULL)
 
virtual GeneralResource_t ReadGeneralResourceID (const eC_Char *pcTag=NULL)
 
virtual eC_UInt ReadHex (const eC_Char *pcTag=NULL)=0
 
virtual ImageResource_t ReadImageID (const eC_Char *pcTag=NULL)
 
virtual eC_Int ReadInt (const eC_Char *pcTag=NULL)=0
 
virtual ObjectHandle_t ReadObjectID (const eC_Char *pcTag=NULL)
 
virtual GlobalProperty_t ReadPropertyID (const eC_Char *pcTag=NULL)
 
virtual eC_Short ReadShort (const eC_Char *pcTag=NULL)=0
 
virtual SoundResource_t ReadSoundID (const eC_Char *pcTag=NULL)
 
virtual eC_Int ReadStreamingFileHeader ()=0
 
virtual eC_String ReadString (const eC_Char *pcTag=NULL)=0
 
virtual TextResource_t ReadTextID (const eC_Char *pcTag=NULL)
 
virtual eC_UByte ReadUByte (const eC_Char *pcTag=NULL)=0
 
virtual eC_UInt ReadUInt (const eC_Char *pcTag=NULL)=0
 
virtual eC_UShort ReadUShort (const eC_Char *pcTag=NULL)=0
 
void ResetStreamingFile ()
 
void SetStreamingFile (eC_File *pkStreamingFile)
 

Additional Inherited Members

- Static Public Member Functions inherited from CGUIStreamReader
static void CreateInstance ()
 
static void DeleteInstance ()
 
static CGUIStreamReaderGetInstance ()
 
- Protected Member Functions inherited from CGUIStreamReader
 CGUIStreamReader (FileType_t eFileType, FileEndianess_t eFileEndianess, FileAlignment_t eFileAlignment)
 
void ResizeReadBuffer (eC_Bool bReset)
 
- Protected Attributes inherited from CGUIStreamReader
eC_TArray< eC_Char > m_aReadBuffer
 Dynamic array to hold currently read tag content.
 
FileAlignment_t m_eFileAlignment
 Alignment of the file.
 
FileEndianess_t m_eFileEndianess
 Endianess of the file.
 
FileType_t m_eFileType
 File Type.
 
eC_String m_kLastReadTag
 Last tag which was read, used to skip to the end of an corrupted object.
 
eC_File * m_pkCurrentInputFile
 Pointer to the current streaming file. All reading operations will be performed on this file.
 
eC_UInt m_uiCurLine
 Line number in current streaming file.
 

Detailed Description

Reads streaming files written by CGUIStreamWriterXML.

This implementation has the ability to compare each tag that was read with the expected tag. Each of the read methods performs a check for the correct tag and throws a CGUIStreamingException if the tags do not match.

To prevent checking of tags, e.g. when the tag is not necessary to be known, just provide an empty string. This will de-activate this check.

If performance in production scenarios is needed the StreamReaderXML might not be the best choice, since it generates lot of overhead for the human-readable file-content and integrity checks. If performance is of the essence the StreamReaderBinary should be used instead.

The ReadString() implementation unescapes XML predefined entities. See StringOperations::UnescapeXML() for details.

Member Function Documentation

◆ Clone()

virtual CGUIStreamReader * CGUIStreamReaderXML::Clone ( ) const
virtual
Returns
clone this stream-reader

Implements CGUIStreamReader.

◆ DeleteCommentTag() [1/2]

virtual void CGUIStreamReaderXML::DeleteCommentTag ( const eC_Char *  pcTag = NULL)
virtual

Reads over (removes) a tag from the current streaming file without reading a value.

Parameters
pcTagOptional descriptive tag.

Implements CGUIStreamReader.

◆ DeleteCommentTag() [2/2]

virtual void CGUIStreamReaderXML::DeleteCommentTag ( const eC_String &  kTag)
virtual

Reads over (removes) a tag from the current streaming file without reading a value.

Parameters
kTagdescriptive tag.

Implements CGUIStreamReader.

◆ GetFileSuffix()

virtual const eC_String & CGUIStreamReaderXML::GetFileSuffix ( ) const
inlinevirtual

Returns the file suffix which is associated with this reader's file format. This can be an empty string, if e.g. the reader works with formats which are unrelated to files.

Returns
String with the associated file suffix (e.g. ".xml")

Reimplemented from CGUIStreamReader.

◆ ReadBinary()

virtual void CGUIStreamReaderXML::ReadBinary ( eC_TArray< eC_UByte > &  aData,
const eC_Char *  pcTag = NULL 
)
virtual

Reads binary stream. Array will be retrieved from stream in raw mode.

Parameters
pcTagOptional descriptive tag.
[out]aDataArray the read data will be set to.

Implements CGUIStreamReader.

◆ ReadBool()

virtual eC_Bool CGUIStreamReaderXML::ReadBool ( const eC_Char *  pcTag = NULL)
virtual

Reads a boolean value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadByte()

virtual eC_Byte CGUIStreamReaderXML::ReadByte ( const eC_Char *  pcTag = NULL)
virtual

Reads a signed byte value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadColor()

virtual ColorValue_t CGUIStreamReaderXML::ReadColor ( const eC_Char *  pcTag = NULL)
virtual

Reads a color from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadFloat()

virtual eC_Float CGUIStreamReaderXML::ReadFloat ( const eC_Char *  pcTag = NULL)
virtual

Reads a float value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadHex()

virtual eC_UInt CGUIStreamReaderXML::ReadHex ( const eC_Char *  pcTag = NULL)
virtual

Reads a hexadecimal integer value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadInt()

virtual eC_Int CGUIStreamReaderXML::ReadInt ( const eC_Char *  pcTag = NULL)
virtual

Reads a signed integer value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadShort()

virtual eC_Short CGUIStreamReaderXML::ReadShort ( const eC_Char *  pcTag = NULL)
virtual

Reads a short value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadStreamingFileHeader()

virtual eC_Int CGUIStreamReaderXML::ReadStreamingFileHeader ( )
inlinevirtual

Reads the file header of a streaming file

Returns
version of the file

Implements CGUIStreamReader.

◆ ReadString()

virtual eC_String CGUIStreamReaderXML::ReadString ( const eC_Char *  pcTag = NULL)
virtual

Reads a string from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The string that has been read.

Implements CGUIStreamReader.

◆ ReadUByte()

virtual eC_UByte CGUIStreamReaderXML::ReadUByte ( const eC_Char *  pcTag = NULL)
virtual

Reads an unsigned byte value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadUInt()

virtual eC_UInt CGUIStreamReaderXML::ReadUInt ( const eC_Char *  pcTag = NULL)
virtual

Reads an unsigned integer value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.

◆ ReadUShort()

virtual eC_UShort CGUIStreamReaderXML::ReadUShort ( const eC_Char *  pcTag = NULL)
virtual

Reads an unsigned short value from the current streaming file.

Parameters
pcTagOptional descriptive tag.
Returns
The value read from the file.

Implements CGUIStreamReader.


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