Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_XMLWriter Class Reference

A class for writing out data in XML format. More...

Inheritance diagram for CP_XMLWriter:

CP_NoCopy List of all members.

Public Member Functions

Constructor / Destructor
 CP_XMLWriter (CP_OutStream *inOutStream, const CP_String &inXMLVersion=CP_String("1.0"), const CP_String &inXMLEncoding=CP_String("UTF-8"))
 Constructor.
virtual ~CP_XMLWriter ()
 Destructor.
Getters
CP_OutStreamGetOutputStream ()
Elements
void SetRootElement (CP_XMLWriter_Element *inRootElement)
Output
bool WriteAll ()
virtual void WriteBytes (const void *inBuffer, UInt32 inNumberBytes)
virtual void WriteHeader ()
virtual void WriteTrailer ()

Protected Attributes

CP_OutStreamfOutStream
CP_String fXMLVersion
CP_String fXMLEncoding
CP_XMLWriter_ElementfRootElement
bool fRootCreated

Detailed Description


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_XMLWriter::CP_XMLWriter CP_OutStream inOutStream,
const CP_String inXMLVersion = CP_String("1.0"),
const CP_String inXMLEncoding = CP_String("UTF-8")
 

Constructor.

Parameters:
inOutStream The CP_OutStream object that the data is written to.
inXMLVersion The version of the XML being used. Defaults to "1.0"
inXMLEncoding The encoding used in the XML file. Defaults to "UTF-8".
Exceptions:
none 

CP_XMLWriter::~CP_XMLWriter  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_OutStream* CP_XMLWriter::GetOutputStream  ) 
 

void CP_XMLWriter::SetRootElement CP_XMLWriter_Element inRootElement  ) 
 

Sets the root element for the XML data.

Parameters:
inRootElement The root element of this XML document.
Exceptions:
none 
Returns:
void

bool CP_XMLWriter::WriteAll  ) 
 

Writes all of the data for this document to the output stream.

Exceptions:
none 
Returns:
bool Returns true, if we were able to write the XML data out.

void CP_XMLWriter::WriteBytes const void *  inBuffer,
UInt32  inNumberBytes
[virtual]
 

Write inNumberBytes from the buffer to our output stream. You normally don't call this, as it is called from each CP_XMLWriter_Element to write its data to our stream.

Parameters:
inBuffer Buffer containing the XML data to be written out.
inNumberBytes Number of bytes to write from the above buffer.
Exceptions:
none 
Returns:
void

void CP_XMLWriter::WriteHeader  )  [virtual]
 

Write the header for the XML document. This contains the version and encoding information.

Exceptions:
none 
Returns:
void

void CP_XMLWriter::WriteTrailer  )  [virtual]
 

Write the trailer for the XML document. This will be the trailer for the root element.

Exceptions:
none 
Returns:
void


Member Data Documentation

CP_OutStream* CP_XMLWriter::fOutStream [protected]
 

CP_String CP_XMLWriter::fXMLVersion [protected]
 

The CP_OutStream object that we will write the data to. This can be either a CP_HandleBlock or CP_File out stream.

CP_String CP_XMLWriter::fXMLEncoding [protected]
 

The version of the XML data -- currently should be 1.0.

CP_XMLWriter_Element* CP_XMLWriter::fRootElement [protected]
 

The encoding that the XML data is written in.

bool CP_XMLWriter::fRootCreated [protected]
 

The root element for the XML data.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:02:36 2005 for CPLAT by  doxygen 1.4.0