Guiliani  Version 2.4 revision 5970 (build 3)
CGUIStreamWriter Class Referenceabstract

Base class for stream writers. More...

#include <GUIStreamWriter.h>

Inheritance diagram for CGUIStreamWriter:

Public Member Functions

virtual ~CGUIStreamWriter ()
 Destructor.
 
FileAlignment_t GetFileAlignment () const
 
FileEndianess_t GetFileEndianess () const
 
virtual const eC_String & GetFileSuffix () const
 
FileType_t GetFileType () const
 
virtual eC_Bool SetFileAlignment (FileAlignment_t eFileAlignment)=0
 
virtual eC_Bool SetFileEndianess (FileEndianess_t eFileEndianess)=0
 
void SetStreamingFile (eC_File *pkStreamingFile)
 
virtual void WriteAnimationChainID (AnimationHandle_t eID, const eC_Char *const pcTag)
 
void WriteAnimationToFile (CGUIAnimation *pAnimation) const
 
void WriteBehaviourToFile (CGUIBehaviourDecorator *pBehaviour) const
 
virtual void WriteBinary (const eC_TArray< eC_UByte > &aData, const eC_Char *const pcTag)=0
 
virtual void WriteBool (const eC_Bool bBool, const eC_Char *const pcTag)=0
 
virtual void WriteByte (const eC_Byte bByte, const eC_Char *const pcTag)=0
 
virtual void WriteColor (const ColorValue_t eColor, const eC_Char *const pcTag)=0
 
void WriteCommandToFile (CGUICommandPtr pCommand) const
 
virtual void WriteCommentTag (const eC_Char *const pcTag)=0
 
virtual void WriteCommentTag (const eC_String &kTag)=0
 
virtual void WriteDataPoolID (DataPoolResource_t eID, const eC_Char *const pcTag)
 
virtual void WriteFloat (const eC_Float fFloat, const eC_Char *const pcTag)=0
 
virtual void WriteFontID (FontResource_t eID, const eC_Char *const pcTag)
 
virtual void WriteGeneralResourceID (GeneralResource_t eID, const eC_Char *const pcTag)
 
virtual void WriteHex (const eC_UInt uiInt, const eC_Char *const pcTag)=0
 
virtual void WriteImageID (ImageResource_t eID, const eC_Char *const pcTag)
 
virtual void WriteInt (const eC_Int iInt, const eC_Char *const pcTag)=0
 
void WriteLayouterToFile (CGUILayouter *pLayouter) const
 
virtual void WriteObjectID (ObjectHandle_t eID, const eC_Char *const pcTag)
 
virtual void WritePropertyID (GlobalProperty_t eID, const eC_Char *const pcTag)
 
virtual void WriteShort (const eC_Short iShort, const eC_Char *const pcTag)=0
 
virtual void WriteSoundID (SoundResource_t eID, const eC_Char *const pcTag)
 
virtual void WriteStreamingFileHeader (const eC_Int iFileVersion)=0
 
virtual void WriteString (const eC_String &pkString, const eC_Char *const pcTag)=0
 
virtual void WriteTextID (TextResource_t eID, const eC_Char *const pcTag)
 
void WriteTextToFile (CGUIText *pText) const
 
virtual void WriteUByte (const eC_UByte ubByte, const eC_Char *const pcTag)=0
 
virtual void WriteUInt (const eC_UInt uiInt, const eC_Char *const pcTag)=0
 
virtual void WriteUShort (const eC_UShort usShort, const eC_Char *const pcTag)=0
 

Static Public Member Functions

static CGUIStreamWriterGetInstance ()
 

Protected Member Functions

 CGUIStreamWriter (FileType_t eFileType, FileEndianess_t eFileEndianess, FileAlignment_t eFileAlignment)
 

Protected Attributes

FileAlignment_t m_eFileAlignment
 Alignment of the file.
 
FileEndianess_t m_eFileEndianess
 Endianess of the file.
 
FileType_t m_eFileType
 File Type.
 
eC_File * m_pkStreamingFile
 The file that the content is written into.
 

Detailed Description

Base class for stream writers.

Stream writers are used to write GUI definitions to files. This abstract base class defines the interfaces for handling streaming files and writing values to them.

Each instance of a stream writer operates on one file at a time. A file can be set by calling SetStreamingFile().

Note
CGUIStreamWriter is NOT responsible for destruction of the streaming file, this should be done by the file creator. Call SetStreamingFile(NULL) after destruction of it, to avoid streaming operations on a non valid file pointer.

After setting a file, the various write methods can be called. Each of them expects a 'tag' which can be a descriptive text string or something else. Implementations can use these tags in whatever way they want. They may choose to ignore the tags.

See also
Streaming

Constructor & Destructor Documentation

◆ CGUIStreamWriter()

CGUIStreamWriter::CGUIStreamWriter ( FileType_t  eFileType,
FileEndianess_t  eFileEndianess,
FileAlignment_t  eFileAlignment 
)
protected

Constructor.

Parameters
eFileTypeinitial file type
eFileEndianessinitial file endianess
eFileAlignmentinitial file alignment

Member Function Documentation

◆ GetFileAlignment()

FileAlignment_t CGUIStreamWriter::GetFileAlignment ( ) const
inline

Gets the alignment of the file

Returns
alignment of the file

◆ GetFileEndianess()

FileEndianess_t CGUIStreamWriter::GetFileEndianess ( ) const
inline

Gets the endianess of the file

Returns
Endianess of the file

◆ GetFileSuffix()

const eC_String & CGUIStreamWriter::GetFileSuffix ( ) const
virtual

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

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

Reimplemented in CGUIStreamWriterXML, and CGUIStreamWriterBinary.

◆ GetFileType()

FileType_t CGUIStreamWriter::GetFileType ( ) const
inline

Gets the type of the file

Returns
type of the file

◆ GetInstance()

CGUIStreamWriter & CGUIStreamWriter::GetInstance ( )
static
Returns
Returns instance of current stream stack's top.

◆ SetFileAlignment()

virtual eC_Bool CGUIStreamWriter::SetFileAlignment ( FileAlignment_t  eFileAlignment)
pure virtual

Sets the alignment of the streamed file

Parameters
eFileAlignmentthe desired alignment
Return values
trueoperation successful
falseoperation not supported

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ SetFileEndianess()

virtual eC_Bool CGUIStreamWriter::SetFileEndianess ( FileEndianess_t  eFileEndianess)
pure virtual

Sets the endianess of the streamed file

Parameters
eFileEndianessthe desired endianess
Return values
trueoperation successful
falseoperation not supported

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ SetStreamingFile()

void CGUIStreamWriter::SetStreamingFile ( eC_File *  pkStreamingFile)

Sets the streaming file. Always sets the streaming file mode to the set endian

Parameters
pkStreamingFileSubsequent write method calls will write into this file.

◆ WriteAnimationChainID()

virtual void CGUIStreamWriter::WriteAnimationChainID ( AnimationHandle_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes an animation chain ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe animation ID to be written.
pcTagOptional descriptive tag.

◆ WriteAnimationToFile()

void CGUIStreamWriter::WriteAnimationToFile ( CGUIAnimation pAnimation) const

Writes an animation object to the streaming file.

Parameters
pAnimationPointer to the animation which should be written.

◆ WriteBehaviourToFile()

void CGUIStreamWriter::WriteBehaviourToFile ( CGUIBehaviourDecorator pBehaviour) const

Writes a behaviour object to the streaming file set by WriteDialogToFile().

Parameters
pBehaviourPointer to the behaviour which should be written.

◆ WriteBinary()

virtual void CGUIStreamWriter::WriteBinary ( const eC_TArray< eC_UByte > &  aData,
const eC_Char *const  pcTag 
)
pure virtual

Write binary stream. Array will be written to stream in raw mode.

Parameters
aDataArray containing data to post
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteBool()

virtual void CGUIStreamWriter::WriteBool ( const eC_Bool  bBool,
const eC_Char *const  pcTag 
)
pure virtual

Writes a bool to the streaming file.

Parameters
bBoolValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterJSON, and CGUIStreamWriterBinary.

◆ WriteByte()

virtual void CGUIStreamWriter::WriteByte ( const eC_Byte  bByte,
const eC_Char *const  pcTag 
)
pure virtual

Writes a byte to the streaming file.

Parameters
bByteValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteColor()

virtual void CGUIStreamWriter::WriteColor ( const ColorValue_t  eColor,
const eC_Char *const  pcTag 
)
pure virtual

Writes a color as a hex value to the streaming file. Same interface as WriteUInt but writers that produce human-readable output may use this method for hex output.

Parameters
eColorcolor-value.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteCommandToFile()

void CGUIStreamWriter::WriteCommandToFile ( CGUICommandPtr  pCommand) const

Writes a command object to the streaming file set by WriteDialogToFile().

Parameters
pCommandPointer to the command which should be written.

◆ WriteCommentTag() [1/2]

virtual void CGUIStreamWriter::WriteCommentTag ( const eC_Char *const  pcTag)
pure virtual

Writes a single tag without a value.

Parameters
pcTagThe tag to be written.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteCommentTag() [2/2]

virtual void CGUIStreamWriter::WriteCommentTag ( const eC_String &  kTag)
pure virtual

Writes a single tag without a value.

Parameters
kTagThe tag to be written.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteDataPoolID()

virtual void CGUIStreamWriter::WriteDataPoolID ( DataPoolResource_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes a DataPool ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe DataPool ID to be written.
pcTagOptional descriptive tag.

◆ WriteFloat()

virtual void CGUIStreamWriter::WriteFloat ( const eC_Float  fFloat,
const eC_Char *const  pcTag 
)
pure virtual

Writes a float to the set streaming file.

Parameters
fFloatValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteFontID()

virtual void CGUIStreamWriter::WriteFontID ( FontResource_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes a font ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe font ID to be written.
pcTagOptional descriptive tag.

◆ WriteGeneralResourceID()

virtual void CGUIStreamWriter::WriteGeneralResourceID ( GeneralResource_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes a general resource ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe general resource ID to be written.
pcTagOptional descriptive tag.

◆ WriteHex()

virtual void CGUIStreamWriter::WriteHex ( const eC_UInt  uiInt,
const eC_Char *const  pcTag 
)
pure virtual

Writes a hex value to the streaming file. Same interface as WriteInt but writers that produce human-readable output may use this method for hex output.

Parameters
uiIntunsigned integer value which should be written as hex.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteImageID()

virtual void CGUIStreamWriter::WriteImageID ( ImageResource_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes an image ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe image ID to be written.
pcTagOptional descriptive tag.

◆ WriteInt()

virtual void CGUIStreamWriter::WriteInt ( const eC_Int  iInt,
const eC_Char *const  pcTag 
)
pure virtual

Writes an integer to the streaming file.

Parameters
iIntValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteLayouterToFile()

void CGUIStreamWriter::WriteLayouterToFile ( CGUILayouter pLayouter) const

Writes a layouter object to the streaming file set by WriteDialogToFile().

Parameters
pLayouterPointer to the layouter which should be written.

◆ WriteObjectID()

virtual void CGUIStreamWriter::WriteObjectID ( ObjectHandle_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes an object handle to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe object ID to be written.
pcTagOptional descriptive tag.

◆ WritePropertyID()

virtual void CGUIStreamWriter::WritePropertyID ( GlobalProperty_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes a Property ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe Property ID to be written.
pcTagOptional descriptive tag.

◆ WriteShort()

virtual void CGUIStreamWriter::WriteShort ( const eC_Short  iShort,
const eC_Char *const  pcTag 
)
pure virtual

Writes a Short to the streaming file.

Parameters
iShortValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterJSON, and CGUIStreamWriterBinary.

◆ WriteSoundID()

virtual void CGUIStreamWriter::WriteSoundID ( SoundResource_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes a sound ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe sound ID to be written.
pcTagOptional descriptive tag.

◆ WriteStreamingFileHeader()

virtual void CGUIStreamWriter::WriteStreamingFileHeader ( const eC_Int  iFileVersion)
pure virtual

Writes the file header

Parameters
iFileVersionfile version

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteString()

virtual void CGUIStreamWriter::WriteString ( const eC_String &  pkString,
const eC_Char *const  pcTag 
)
pure virtual

Writes a string to the set streaming file.

Parameters
pkStringValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteTextID()

virtual void CGUIStreamWriter::WriteTextID ( TextResource_t  eID,
const eC_Char *const  pcTag 
)
inlinevirtual

Writes a text ID to the streaming file. The call is directly forwarded to WriteInt().

Parameters
eIDThe text ID to be written.
pcTagOptional descriptive tag.

◆ WriteTextToFile()

void CGUIStreamWriter::WriteTextToFile ( CGUIText pText) const

Writes a text object to the streaming file set by WriteDialogToFile().

Parameters
pTextPointer to the text which should be written.

◆ WriteUByte()

virtual void CGUIStreamWriter::WriteUByte ( const eC_UByte  ubByte,
const eC_Char *const  pcTag 
)
pure virtual

Writes an unsigned byte to the streaming file.

Parameters
ubByteValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteUInt()

virtual void CGUIStreamWriter::WriteUInt ( const eC_UInt  uiInt,
const eC_Char *const  pcTag 
)
pure virtual

Writes an unsigned integer to the streaming file.

Parameters
uiIntValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.

◆ WriteUShort()

virtual void CGUIStreamWriter::WriteUShort ( const eC_UShort  usShort,
const eC_Char *const  pcTag 
)
pure virtual

Writes an unsigned short to the streaming file.

Parameters
usShortValue which should be written.
pcTagOptional descriptive tag.

Implemented in CGUIStreamWriterXML, CGUIStreamWriterBinary, and CGUIStreamWriterJSON.


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