Base class for stream writers. More...
#include <GUIStreamWriter.h>
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 *pkAnimation) const |
void | WriteBehaviourToFile (CGUIBehaviourDecorator *pkBehaviour) 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 pkCommand) 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 *pkLayouter) 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 |
virtual void | WriteUUID (UUID_t eID, const eC_Char *const pcTag) |
Static Public Member Functions | |
static void | CreateInstance () |
static void | DeleteInstance () |
static CGUIStreamWriter & | GetInstance () |
Protected Member Functions | |
CGUIStreamWriter (FileType_t eFileType, FileEndianess_t eFileEndianess, FileAlignment_t eFileAlignment) | |
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().
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.
|
protected |
Constructor.
eFileType | initial file type |
eFileEndianess | initial file endianess |
eFileAlignment | initial file alignment |
|
static |
Create Instance
|
static |
Delete Instance
|
inline |
Gets the alignment of the file
|
inline |
Gets the endianess of the file
|
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.
Reimplemented in CGUIStreamWriterBinary, and CGUIStreamWriterXML.
|
inline |
Gets the type of the file
|
static |
|
pure virtual |
Sets the alignment of the streamed file
eFileAlignment | the desired alignment |
true | operation successful |
false | operation not supported |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Sets the endianess of the streamed file
eFileEndianess | the desired endianess |
true | operation successful |
false | operation not supported |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
void CGUIStreamWriter::SetStreamingFile | ( | eC_File * | pkStreamingFile | ) |
Sets the streaming file. Always sets the streaming file mode to the set endian
pkStreamingFile | Subsequent write method calls will write into this file. |
|
inlinevirtual |
Writes an animation chain ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The animation ID to be written. |
pcTag | Optional descriptive tag. |
void CGUIStreamWriter::WriteAnimationToFile | ( | CGUIAnimation * | pkAnimation | ) | const |
Writes an animation object to the streaming file.
pkAnimation | Pointer to the animation which should be written. |
void CGUIStreamWriter::WriteBehaviourToFile | ( | CGUIBehaviourDecorator * | pkBehaviour | ) | const |
Writes a behaviour object to the streaming file set by WriteDialogToFile().
pkBehaviour | Pointer to the behaviour which should be written. |
|
pure virtual |
Write binary stream. Array will be written to stream in raw mode.
aData | Array containing data to post |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Writes a bool to the streaming file.
bBool | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Writes a byte to the streaming file.
bByte | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
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.
eColor | color-value. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
void CGUIStreamWriter::WriteCommandToFile | ( | CGUICommandPtr | pkCommand | ) | const |
Writes a command object to the streaming file set by WriteDialogToFile().
pkCommand | Pointer to the command which should be written. |
|
pure virtual |
Writes a single tag without a value.
pcTag | The tag to be written. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Writes a single tag without a value.
kTag | The tag to be written. |
Implemented in CGUIStreamWriterJSON, CGUIStreamWriterXML, and CGUIStreamWriterBinary.
|
inlinevirtual |
Writes a DataPool ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The DataPool ID to be written. |
pcTag | Optional descriptive tag. |
|
pure virtual |
Writes a float to the set streaming file.
fFloat | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
inlinevirtual |
Writes a font ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The font ID to be written. |
pcTag | Optional descriptive tag. |
|
inlinevirtual |
Writes a general resource ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The general resource ID to be written. |
pcTag | Optional descriptive tag. |
|
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.
uiInt | unsigned integer value which should be written as hex. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
inlinevirtual |
Writes an image ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The image ID to be written. |
pcTag | Optional descriptive tag. |
|
pure virtual |
Writes an integer to the streaming file.
iInt | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
void CGUIStreamWriter::WriteLayouterToFile | ( | CGUILayouter * | pkLayouter | ) | const |
Writes a layouter object to the streaming file set by WriteDialogToFile().
pkLayouter | Pointer to the layouter which should be written. |
|
inlinevirtual |
Writes an object handle to the streaming file. The call is directly forwarded to WriteInt().
eID | The object ID to be written. |
pcTag | Optional descriptive tag. |
|
inlinevirtual |
Writes a Property ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The Property ID to be written. |
pcTag | Optional descriptive tag. |
|
pure virtual |
Writes a Short to the streaming file.
iShort | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterJSON, CGUIStreamWriterXML, and CGUIStreamWriterBinary.
|
inlinevirtual |
Writes a sound ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The sound ID to be written. |
pcTag | Optional descriptive tag. |
|
pure virtual |
Writes the file header
iFileVersion | file version |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Writes a string to the set streaming file.
pkString | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
inlinevirtual |
Writes a text ID to the streaming file. The call is directly forwarded to WriteInt().
eID | The text ID to be written. |
pcTag | Optional descriptive tag. |
void CGUIStreamWriter::WriteTextToFile | ( | CGUIText * | pText | ) | const |
Writes a text object to the streaming file set by WriteDialogToFile().
pText | Pointer to the text which should be written. |
|
pure virtual |
Writes an unsigned byte to the streaming file.
ubByte | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Writes an unsigned integer to the streaming file.
uiInt | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
pure virtual |
Writes an unsigned short to the streaming file.
usShort | Value which should be written. |
pcTag | Optional descriptive tag. |
Implemented in CGUIStreamWriterBinary, CGUIStreamWriterJSON, and CGUIStreamWriterXML.
|
inlinevirtual |
Writes a UUID to the streaming file.
eID | the UUID to be written |
pcTag | Optional descriptive tag. |