★如何用CMarkup类读写XML文件,回答完美者我叫他★阿哥★
本小姐刚毕业呀,学识不多希望各位帮助。^_^偏偏需要用到个英文的注释源码,偶英文又不好,气死人!所有问问各位大哥!主要需要解释如下函数,用过的人帮我下,写下函数的用法和注意事项。^_^
-----------------阿哥-----------
CMarkup() { SetDoc( NULL ); };
CMarkup( LPCTSTR szDoc ) { SetDoc( szDoc ); };
CMarkup( const CMarkup& markup ) { *this = markup; };
void operator=( const CMarkup& markup );
virtual ~CMarkup() {};
// Navigate
bool Load( LPCTSTR szFileName );
bool SetDoc( LPCTSTR szDoc );
bool IsWellFormed();
bool FindElem( LPCTSTR szName=NULL );
bool FindChildElem( LPCTSTR szName=NULL );
bool IntoElem();
bool OutOfElem();
void ResetChildPos() ;
void ResetMainPos() ;
void ResetPos() ;
CString GetTagName() const;
CString GetChildTagName() const ;
CString GetData() const ;
CString GetChildData() const ;
CString GetAttr( LPCTSTR szAttr ) const ;
CString GetChildAttr( LPCTSTR szAttr ) const ;
CString GetAttrName( int n ) const;
bool SavePos( LPCTSTR szPosName=_T("") );
bool RestorePos( LPCTSTR szPosName=_T("") );
bool GetOffsets( int& nStart, int& nEnd ) const;
CString GetError() const { return m_csError; };
// Create
bool Save( LPCTSTR szFileName );
CString GetDoc() const ;
bool AddElem( LPCTSTR szName, LPCTSTR szData=NULL ) ;
bool InsertElem( LPCTSTR szName, LPCTSTR szData=NULL ) ;
bool AddChildElem( LPCTSTR szName, LPCTSTR szData=NULL ) ;
bool InsertChildElem( LPCTSTR szName, LPCTSTR szData=NULL ) ;
bool AddAttr( LPCTSTR szAttr, LPCTSTR szValue ) ;
bool AddChildAttr( LPCTSTR szAttr, LPCTSTR szValue ) ;
bool AddAttr( LPCTSTR szAttr, int nValue ) ;
bool AddChildAttr( LPCTSTR szAttr, int nValue ) ;
bool AddChildSubDoc( LPCTSTR szSubDoc ) ;
bool InsertChildSubDoc( LPCTSTR szSubDoc ) ;
CString GetChildSubDoc() const;
// Modify
bool RemoveElem();
bool RemoveChildElem();
bool SetAttr( LPCTSTR szAttr, LPCTSTR szValue ) ;
bool SetChildAttr( LPCTSTR szAttr, LPCTSTR szValue ) ;
bool SetAttr( LPCTSTR szAttr, int nValue ) ;
bool SetChildAttr( LPCTSTR szAttr, int nValue ) ;
bool SetData( LPCTSTR szData, int nCDATA=0 ) ;
bool SetChildData( LPCTSTR szData, int nCDATA=0 );