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

CP_XMLWriter_Element Class Reference

XML entry class that represents an element in an XML file. This is the main class for writing data to an XML file. An element can have children and attributes. More...

Inheritance diagram for CP_XMLWriter_Element:

CP_XMLWriter_Entry CP_M_XMLEntry_Attributes CP_NoCopy CP_NoCopy List of all members.

Public Member Functions

Constructor / Destructor
 CP_XMLWriter_Element (CP_XMLWriter *inXMLWriter, CP_XMLWriter_Element *inParentElement, const CP_String &inTag, const CP_String &inData="")
 Constructor.
virtual ~CP_XMLWriter_Element ()
 Destructor.
CData
void AddCData (CP_HandleBlock *inHandleBlock)
void AddCData (const CP_String &inStringData)
Getters
SInt16 GetElementDataType ()
Setters
virtual void SetData (const CP_String &inData)
Writers
virtual void WriteHeader (CP_XMLWriter *inXMLWriter=NULL)
virtual void WriteTrailer (CP_XMLWriter *inXMLWriter=NULL)
virtual void WriteData (CP_XMLWriter *inXMLWriter=NULL)

Protected Member Functions

Formatters
virtual CP_String FormatStringForXML (const CP_String &inOutString)

Protected Attributes

CP_HandleBlock * fCData
SInt16 fElementDataType
CP_XMLWriter * fXMLWriter
CP_XMLWriter_Entry * fParentElement
CP_String fTag
CP_String fData
CP_XMLElements_Array * fElements
bool fIsWritten
CP_XMLAttributes_Array * fAttributes

Private Member Functions

CData
void WriteCData (CP_XMLWriter *inXMLWriter)

Detailed Description


Constructor & Destructor Documentation

CP_XMLWriter_Element::CP_XMLWriter_Element (  CP_XMLWriter *  inXMLWriter,
CP_XMLWriter_Element *  inParentElement,
const CP_String &  inTag,
const CP_String &  inData = ""
) 
 

Constructor.

Parameters:
inXMLWriter - the CP_XMLWriter object that this element is a part of.
inParentElement - the parent element of this comment.
inTag - the data that the data is referred by.
inData - the data for this element.

CP_XMLWriter_Element::~CP_XMLWriter_Element (   )  [virtual]
 

Destructor.


Member Function Documentation

void CP_XMLWriter_Element::AddCData (  CP_HandleBlock *  inHandleBlock  ) 
 

Adds the contents of the passed in CP_HandleBlock as CData.

Parameters:
inHandleBlock - the CP_HandleBlock that contains the data to be added.

void CP_XMLWriter_Element::AddCData (  const CP_String &  inStringData  ) 
 

Adds the contents of the passed in CP_String as CData.

Parameters:
inStringData - the CP_String that contains the data to be added.

SInt16 CP_XMLWriter_Element::GetElementDataType (   ) 
 

void CP_XMLWriter_Element::SetData (  const CP_String &  inData  )  [virtual]
 

Write the data for this element out.

Reimplemented from CP_XMLWriter_Entry.

void CP_XMLWriter_Element::WriteHeader (  CP_XMLWriter *  inXMLWriter = NULL  )  [virtual]
 

Write the header for this element out.

Reimplemented from CP_XMLWriter_Entry.

void CP_XMLWriter_Element::WriteTrailer (  CP_XMLWriter *  inXMLWriter = NULL  )  [virtual]
 

Write the trailer for this element out.

Reimplemented from CP_XMLWriter_Entry.

void CP_XMLWriter_Element::WriteData (  CP_XMLWriter *  inXMLWriter = NULL  )  [virtual]
 

Write the data for this element out.

Reimplemented from CP_XMLWriter_Entry.

CP_String CP_XMLWriter_Element::FormatStringForXML (  const CP_String &  inString  )  [protected, virtual]
 

Format the passed in string to be a valid string for XML. This will convert all characters above 128 to their hex equivalent, and take care of &, and other characters.

Parameters:
inString - the CP_String containing the data to format.

returnString = convertedString;

void CP_XMLWriter_Element::WriteCData (  CP_XMLWriter *  inXMLWriter  )  [private]
 

Write any CData for this element out.

CP_XMLWriter* CP_XMLWriter_Entry::GetXMLWriter (   )  [inherited]
 

virtual const CP_String CP_XMLWriter_Entry::GetData (   )  const [virtual, inherited]
 

void CP_XMLWriter_Entry::SetTag (  const CP_String &  inTag  )  [inherited]
 

void CP_XMLWriter_Entry::AddChildElement (  CP_XMLWriter_Entry *  inChildElement  )  [inherited]
 

Add a new child element to ourselves.

Parameters:
inChildElement - the element to add.

UInt32 CP_XMLWriter_Entry::GetElementsDepth (   )  [inherited]
 

Return the depth (from the root item) of our element. This information is used to figure out how much to indent our element in listings.

UInt32 CP_XMLWriter_Entry::GetNumberChildElements (   )  [inherited]
 

Return the number of child elements for ourselves.

CP_XMLWriter_Entry * CP_XMLWriter_Entry::GetNthChildElement (  UInt32  inIndex  )  [inherited]
 

Return the child element at inIndex.

Parameters:
inIndex - the index of the item to return.

bool CP_XMLWriter_Entry::IsWritten (   )  [inherited]
 

void CP_XMLWriter_Entry::Write (  CP_XMLWriter *  inXMLWriter = NULL  )  [inherited]
 

Write the data for this element out.

void CP_M_XMLEntry_Attributes::AddAttribute (  const CP_XMLWriter_ElementAttribute &  inAttribute  )  [inherited]
 

Add a new attribute to our list of attributes.

Parameters:
inAttribute - the attribute we are adding.

UInt32 CP_M_XMLEntry_Attributes::GetNumberAttributes (   )  [inherited]
 

Return the number of attributes for ourselves.

CP_XMLWriter_ElementAttribute CP_M_XMLEntry_Attributes::GetNthAttribute (  UInt32  inIndex  )  [inherited]
 

Return the attribute at inIndex.

Parameters:
inIndex - the index of the attribute to retrieve.

void CP_M_XMLEntry_Attributes::AddAttributesToHeader (  CP_String &  inHeader  )  [protected, inherited]
 

Adds the data for all of our attributes to the passed in string, correctly formatted for output.


Member Data Documentation

CP_HandleBlock* CP_XMLWriter_Element::fCData [protected]
 

SInt16 CP_XMLWriter_Element::fElementDataType [protected]
 

If the element contains CData, then this object contains the data to be written.

CP_XMLWriter* CP_XMLWriter_Entry::fXMLWriter [protected, inherited]
 

CP_XMLWriter_Entry* CP_XMLWriter_Entry::fParentElement [protected, inherited]
 

The XMLWriter that we are going to write the data to.

CP_String CP_XMLWriter_Entry::fTag [protected, inherited]
 

The parent element that this entry goes with.

CP_String CP_XMLWriter_Entry::fData [protected, inherited]
 

The tag for this entry.

CP_XMLElements_Array* CP_XMLWriter_Entry::fElements [protected, inherited]
 

The actual data for the entry.

bool CP_XMLWriter_Entry::fIsWritten [protected, inherited]
 

A list of child elements for this entry.

CP_XMLAttributes_Array* CP_M_XMLEntry_Attributes::fAttributes [protected, inherited]
 


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