#include <RmXMLManager.h>
Public Member Functions | |
| IRmXMLManager () | |
| Constructor. | |
| virtual | ~IRmXMLManager () |
| Destructor. | |
| virtual int | InitXMLDocument ()=0 |
| Initialize document. | |
| virtual void | DeleteXMLDocument (int hDoc)=0 |
| Close XML document. | |
| virtual bool | LoadFromFile (int hDoc, const RM_TCHAR *strFileName)=0 |
| Load from file. | |
| virtual bool | SaveToFile (int hDoc, const RM_TCHAR *strFileName)=0 |
| Save to file. | |
| virtual bool | GetAttributeValue (int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strAttribName, RmStringT &result)=0 |
| Get attribute. | |
| virtual bool | SetAttributeValue (int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strAttribName, const RM_TCHAR *strValue)=0 |
| Set attribute. | |
| virtual bool | GetNodeName (int hDoc, const RM_TCHAR *strXPath, RmStringT &result)=0 |
| Get node name. | |
| virtual bool | AddAttribute (int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strAttribName, const RM_TCHAR *strValue)=0 |
| Add attribute. | |
| virtual bool | DeleteAttribute (int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strAttribName)=0 |
| Add attribute. | |
| virtual int | GetNumChildNodes (int hDoc, const RM_TCHAR *strXPath)=0 |
| Get number of child nodes. | |
| virtual bool | AddChildNode (int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strNewNodeTypeName, RmStringT *pNewChildPath=NULL)=0 |
| Add child node. | |
| virtual bool | AddCDATANode (int hDoc, const RM_TCHAR *strXPath)=0 |
| Add CDATA node. | |
| virtual bool | DeleteNode (int hDoc, const RM_TCHAR *strXPath)=0 |
| Delete node. | |
| virtual bool | GetXPathForChild (int hDoc, const RM_TCHAR *strXPathToParent, int childIndex, RmStringT &resultXpath)=0 |
| Get x path for child. | |
| virtual bool | GetTypeText (int hDoc, const RM_TCHAR *xpath, RmStringT &resultText)=0 |
| Get type text. | |
| virtual bool | SetTypeText (int hDoc, const RM_TCHAR *xpath, const RM_TCHAR *text)=0 |
| Set type text. | |
| virtual bool | AddTypeText (int hDoc, const RM_TCHAR *xpath, const RM_TCHAR *name, const RM_TCHAR *text)=0 |
| Add type text. | |
| virtual bool | DeleteTypeText (int hDoc, const RM_TCHAR *xpath)=0 |
| Delete type text. | |
| virtual bool | AddNodeText (int hDoc, const RM_TCHAR *xpath, const RM_TCHAR *text)=0 |
| Add node text. | |
| virtual bool | ReadXMLHeader (int hDoc, bool bValidate)=0 |
| Read XML hader. | |
| virtual bool | AddXMLHeader (int hDoc, const RM_TCHAR *pStrRootNode, const RM_TCHAR *pStrDTDHeader=NULL)=0 |
| Add XML header. | |
The IRmXMLManager provides an interface that hides a lot of implementation details of dealing with an xml file through MSXML. All data contained in a RenderMonkey xml (.rfx) file can be queried through this interface. The application maintains an instance of this manager, which is available through the IRmApplication::GetXMLManager() function. PlugIns would use the following code to gain access to the interface: getRmApp()->GetXMLManager();
|
|
Constructor. Default constructor |
|
|
Destructor. Destructor |
|
||||||||||||||||||||
|
Add attribute. Add Attributes. Used when adding a specific node attribute. The specific attribute is set through the strAttribName, and the node is determined through the CPath location set in strXPath.
|
|
||||||||||||
|
Add CDATA node. Add CDATA Node. This function will add a CDATA block to an xml node. CDATA. Use the IRmXMLManager::SetTypeText function to save a string of text into the CDATA block. CDATA sections will not be parsed as xml.
|
|
||||||||||||||||||||
|
Add child node. Add child node. This function will add a new node to the XML tree. This can be used to manually add a new xml node type, and then the user can manually add attributes as necessary. If this is done, the user must be certain to follow the rules outlined by the DTD, otherwise load warnings may be issued upon xml validation failures. The strNewNodeTypeName parameter is not to be confused with the NAME attribute.
|
|
||||||||||||||||
|
Add node text. This function can be used to add whitespace to the xml file. This will greatly aid in keeping the file readable in a general text editor.
|
|
||||||||||||||||||||
|
Add type text. Used to add a text type xml node data. Used in conjunction with IRmXMLManager::AddCDATANode, these functions will add/delete the block data.
|
|
||||||||||||||||
|
Add XML header. This function is used to add a specific DTD to the xml file. The DTD that will dictate the acceptable structure of the created xml.
|
|
||||||||||||||||
|
Add attribute. Delete Attributes. Used when deleting a specific node attribute. The specific attribute is set through the strAttribName, and the node is determined through the CPath location set in strXPath.
|
|
||||||||||||
|
Delete node. Delete node. THis function will delete an xml node branch, as specified by the XPath location strXPath. This can be used after reading node type specific data branches, to prevent RenderMonkey from trying to 'create' these nodes, which are not recignized runtime database node types.
|
|
||||||||||||
|
Delete type text. Used to delete a text type xml node data. Used in conjunction with IRmXMLManager::AddCDATANode, these functions will add/delete the block data.
|
|
|
Close XML document. Closes XML document, hDoc is a handle returned by InitXMLDocument. This function will get called after the xml document has been fully loaded or saved, and no further xml operations are needed.
|
|
||||||||||||||||||||
|
Get attribute. Returns true if success, false otherwise. strXPath is the XPath location of the node, and strAttribName is the xml attribute name. Please refer to the ..rfx files for details regarding the expected xml structure. The DTD is included in all saved workspaces, and is used as part of the load xml validation procedure.
|
|
||||||||||||||||
|
Get node name. Node Name. Given the XPath location of the node, GetNodeName will return the xml name at the location. This name is normally the RenderMonkey node type, and should be used to determine what attributes should get loaded. This string can be used in the IRmApplication::CreateNode function to create a node of the specified type.
|
|
||||||||||||
|
Get number of child nodes. Returns number of child nodes under given node. This function is used to determine how many calls to IRmXMLManager::GetXPathForChild are required to read in an entire xml tree branch.
|
|
||||||||||||||||
|
Get type text. Used to Get a text type xml node data. Used in conjunction with IRmXMLManager::AddCDATANode, these functions will get/set the block data.
|
|
||||||||||||||||||||
|
Get x path for child. Returns complete XPath for child, given path to parent and nIndex of the child. Used in conjunction with IRmXMLManager::GetNumChildNodes, this is used to programatically traverse the entire xml DOM tree.
|
|
|
Initialize document. Creates XML document and returns handle ( integer ). This function gets called before an xml document can be loaded or saved using this interface, and is normally called immediately after the interface pointer has been received through the application. The returned handle is used in all remaining interface function calls.
|
|
||||||||||||
|
Load from file. Load From File. This function will load the specified an xml file, and store the resulting DOM internally. The user must use the access functions outlined below to query the DOM about the loaded data. If the xml failed xml validation, and the the user set the bValidate flag to true through the IRmXMLManager::ReadXMLHeader function, then a popup dialog will detail the error for the user.
|
|
||||||||||||
|
Read XML hader. This function is used to set the validation flag when loading an xml file. The xml "header" contains a DTD that can dictate the acceptable structure of the included xml.
|
|
||||||||||||
|
Save to file. Save to File. This function will save the loaded DOM into the specified xml file.
|
|
||||||||||||||||||||
|
Set attribute. Returns true if success, false otherwise. strXPath is the XPath location of the node, and strAttribName is the xml attribute name. Please refer to the ..rfx files for details regarding the expected xml structure. The DTD is included in all saved workspaces, and is used as part of the load xml validation procedure.
|
|
||||||||||||||||
|
Set type text. Used to set a text type xml node data. Used in conjunction with IRmXMLManager::AddCDATANode, these functions will get/set the block data.
|
1.3.6