00001 //============================================================================= 00002 // filename: RmXMLManager.h 00003 // 00004 // ATI Research, Inc. 00005 // 3D Application Research Group 00006 // 00007 // description: RenderMonkey XML Manager 00008 // 00009 //============================================================================= 00010 // (C) 2004 ATI Research, Inc. All rights reserved. 00011 //============================================================================= 00012 00013 #ifndef _RM_CORE_XML_MANAGER_H_ 00014 #define _RM_CORE_XML_MANAGER_H_ 00015 00016 #include <Core/RmTypes.h> 00017 #include <Core/RmDefines.h> 00018 #include <Core/RmString.h> 00019 00020 //============================================================================= 00021 // 00022 // XMLManager Interface 00023 // 00024 //============================================================================= 00025 00026 //============================================================================= 00036 //============================================================================= 00037 class RM_API IRmXMLManager 00038 { 00039 public : 00040 //-------------------------------------------------------------------------- 00045 //-------------------------------------------------------------------------- 00046 IRmXMLManager(); 00047 00048 //-------------------------------------------------------------------------- 00053 //-------------------------------------------------------------------------- 00054 virtual ~IRmXMLManager(); 00055 00056 //-------------------------------------------------------------------------- 00066 //-------------------------------------------------------------------------- 00067 virtual int InitXMLDocument() = 0; 00068 00069 //-------------------------------------------------------------------------- 00077 //-------------------------------------------------------------------------- 00078 virtual void DeleteXMLDocument( int hDoc ) = 0; 00079 00080 //-------------------------------------------------------------------------- 00093 //-------------------------------------------------------------------------- 00094 virtual bool LoadFromFile( int hDoc, const RM_TCHAR *strFileName ) = 0; 00095 00096 //-------------------------------------------------------------------------- 00105 //-------------------------------------------------------------------------- 00106 virtual bool SaveToFile( int hDoc, const RM_TCHAR *strFileName ) = 0; 00107 00108 //-------------------------------------------------------------------------- 00122 //-------------------------------------------------------------------------- 00123 virtual bool GetAttributeValue( int hDoc, 00124 const RM_TCHAR *strXPath, 00125 const RM_TCHAR *strAttribName, 00126 RmStringT& result ) = 0; 00127 00128 //-------------------------------------------------------------------------- 00142 //-------------------------------------------------------------------------- 00143 virtual bool SetAttributeValue( int hDoc, 00144 const RM_TCHAR *strXPath, 00145 const RM_TCHAR *strAttribName, 00146 const RM_TCHAR *strValue ) = 0; 00147 00148 //-------------------------------------------------------------------------- 00161 //-------------------------------------------------------------------------- 00162 virtual bool GetNodeName( int hDoc, 00163 const RM_TCHAR *strXPath, 00164 RmStringT& result ) = 0; 00165 00166 //-------------------------------------------------------------------------- 00178 //-------------------------------------------------------------------------- 00179 virtual bool AddAttribute( int hDoc, 00180 const RM_TCHAR *strXPath, 00181 const RM_TCHAR *strAttribName, 00182 const RM_TCHAR *strValue ) = 0; 00183 00184 //-------------------------------------------------------------------------- 00195 //-------------------------------------------------------------------------- 00196 virtual bool DeleteAttribute( int hDoc, 00197 const RM_TCHAR *strXPath, 00198 const RM_TCHAR *strAttribName ) = 0; 00199 00200 //-------------------------------------------------------------------------- 00210 //-------------------------------------------------------------------------- 00211 virtual int GetNumChildNodes( int hDoc, 00212 const RM_TCHAR *strXPath ) = 0; 00213 00214 00215 //-------------------------------------------------------------------------- 00230 //-------------------------------------------------------------------------- 00231 virtual bool AddChildNode( int hDoc, 00232 const RM_TCHAR *strXPath, 00233 const RM_TCHAR *strNewNodeTypeName, 00234 RmStringT *pNewChildPath = NULL ) = 0; 00235 00236 //-------------------------------------------------------------------------- 00246 //-------------------------------------------------------------------------- 00247 virtual bool AddCDATANode( int hDoc, const RM_TCHAR *strXPath ) = 0; 00248 00249 //-------------------------------------------------------------------------- 00260 //-------------------------------------------------------------------------- 00261 virtual bool DeleteNode( int hDoc, 00262 const RM_TCHAR *strXPath ) = 0; 00263 00264 //-------------------------------------------------------------------------- 00276 //-------------------------------------------------------------------------- 00277 virtual bool GetXPathForChild( int hDoc, 00278 const RM_TCHAR *strXPathToParent, 00279 int childIndex, 00280 RmStringT &resultXpath ) = 0; 00281 00282 //-------------------------------------------------------------------------- 00283 // Text Type Helper 00284 //-------------------------------------------------------------------------- 00285 00286 //-------------------------------------------------------------------------- 00296 //-------------------------------------------------------------------------- 00297 virtual bool GetTypeText(int hDoc, const RM_TCHAR *xpath, RmStringT &resultText ) = 0; 00298 00299 //-------------------------------------------------------------------------- 00309 //-------------------------------------------------------------------------- 00310 virtual bool SetTypeText(int hDoc, const RM_TCHAR *xpath, const RM_TCHAR *text ) = 0; 00311 00312 //-------------------------------------------------------------------------- 00323 //-------------------------------------------------------------------------- 00324 virtual bool AddTypeText(int hDoc, const RM_TCHAR *xpath, const RM_TCHAR *name, const RM_TCHAR *text ) = 0; 00325 00326 //-------------------------------------------------------------------------- 00335 //-------------------------------------------------------------------------- 00336 virtual bool DeleteTypeText(int hDoc, const RM_TCHAR *xpath ) = 0; 00337 00338 //-------------------------------------------------------------------------- 00348 //-------------------------------------------------------------------------- 00349 virtual bool AddNodeText(int hDoc, const RM_TCHAR *xpath, const RM_TCHAR *text ) = 0; 00350 00351 //-------------------------------------------------------------------------- 00352 // Read/Write XML Header 00353 //-------------------------------------------------------------------------- 00354 00355 //-------------------------------------------------------------------------- 00365 //-------------------------------------------------------------------------- 00366 virtual bool ReadXMLHeader( int hDoc, bool bValidate ) = 0; 00367 00368 //-------------------------------------------------------------------------- 00378 //-------------------------------------------------------------------------- 00379 virtual bool AddXMLHeader( int hDoc, const RM_TCHAR *pStrRootNode, const RM_TCHAR *pStrDTDHeader = NULL ) = 0; 00380 00381 }; // End of IRmXMLManager 00382 00383 #endif
1.3.6