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

CP_XMLDocument Class Reference

A class to handle XML documents and the ability to both parse into a tree structre and write back out. More...

Inheritance diagram for CP_XMLDocument:

CP_NoCopy List of all members.

Public Member Functions

Constructor / Destructor
 CP_XMLDocument ()
 Constructor.
virtual ~CP_XMLDocument ()
 Destructor.
Child Nodes
CP_XMLDocNodeGetRootNode ()
void SetRootNode (CP_XMLDocNode *inRootNode)
Parsing
void ParseXML (const CP_FileSystemSpec &inXMLFileSpec, bool inUseOSNative=true)
void ParseXML (const CP_HandleBlock &inXMLData)
void ParseXML (CP_InStream &inXMLStream)
Writing
void WriteXML (const CP_FileSystemSpec &inXMLFileSpec, FourCharCode inCreator=0, FourCharCode inType=kCP_Text_FileType)
CP_HandleBlockWriteXML ()

Protected Attributes

CP_XMLDocNodefRootNode

Private Member Functions

Writing
void WriteNode (CP_XMLDocNode *inNode, CP_XMLWriter_Element *inParentElement)
void WriteChildNodes (CP_XMLDocNode *inNode, CP_XMLWriter_Element *inParentElement)

Detailed Description


Constructor & Destructor Documentation

CP_XMLDocument::CP_XMLDocument  ) 
 

Constructor.

Exceptions:
none 

CP_XMLDocument::~CP_XMLDocument  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_XMLDocNode* CP_XMLDocument::GetRootNode  ) 
 

Returns the outter most or root node of this XML document.

Exceptions:
none 
Returns:
CP_XMLDocNode * The root node.

void CP_XMLDocument::SetRootNode CP_XMLDocNode inRootNode  ) 
 

Sets the root node for this document.

Parameters:
inRootNode The root node for this documents.
Exceptions:
none 
Returns:
void

void CP_XMLDocument::ParseXML const CP_FileSystemSpec inXMLFileSpec,
bool  inUseOSNative = true
 

Read in and parse the passed in XML file. This will open and read in the XML document creating a list of nodes for each encountered element. The root node then can be accessed by the GetRootNode() method.

Parameters:
inXMLFileSpec A CP_FileSystemSpec to the XML file to be parsed.
Exceptions:
none 
Returns:
void

void CP_XMLDocument::ParseXML const CP_HandleBlock inXMLData  ) 
 

Read in and parse the passed in XML data. The XML data is contained in the passed in handle block. This will parse the XML document creating a list of nodes for each encountered element. The root node then can be accessed by the GetRootNode() method.

Parameters:
inXMLData A CP_HandleBlock containing the data to be parsed.
Exceptions:
none 
Returns:
void

void CP_XMLDocument::ParseXML CP_InStream inXMLStream  ) 
 

Read in and parse the passed in XML data. The XML data is contained in the passed in stream. This will parse the XML document creating a list of nodes for each encountered element. The root node then can be accessed by the GetRootNode() method.

Parameters:
inXMLStream A stream containing the data to be parsed.
Exceptions:
none 
Returns:
void

void CP_XMLDocument::WriteXML const CP_FileSystemSpec inXMLFileSpec,
FourCharCode  inCreator = 0,
FourCharCode  inType = kCP_Text_FileType
 

Write out this documents data to a file containing the XML data. The file is written to the location specified by the passed in CP_FileSystemSpec.

Parameters:
inXMLFileSpec A CP_FileSystemSpec for the destination file.
inCreator The creator code for the xml file being written.
inType The file type for the xml file being written.
Exceptions:
none 
Returns:
void

CP_HandleBlock * CP_XMLDocument::WriteXML  ) 
 

Write out this documents data to a CP_HandleBlock containing the XML data.

Exceptions:
none 
Returns:
CP_HandleBlock * The XML data.

void CP_XMLDocument::WriteNode CP_XMLDocNode inNode,
CP_XMLWriter_Element inParentElement
[private]
 

Write out the passed in inNode, which is a node for the passed in inParentElement.

Parameters:
inNode A node containing some XML data that is a child of the passed in parent element.
inParentElement The parent element for the node.
Exceptions:
none 
Returns:
void

void CP_XMLDocument::WriteChildNodes CP_XMLDocNode inNode,
CP_XMLWriter_Element inParentElement
[private]
 

Write out all of the child nodes of the passed in inNode. All of the child nodes are made a parent of inParentElement when writing them out.

Parameters:
inNode A node containing the child nodes to write out.
inParentElement The parent element for the nodes being written.
Exceptions:
none 
Returns:
void


Member Data Documentation

CP_XMLDocNode* CP_XMLDocument::fRootNode [protected]
 


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