資源簡介
嘗試了許多c++ xml類,個人認為這是最容易入手的c++ xml類,可以跨平臺用的。本人現在使用的就是這個。

代碼片段和文件信息
/*
http://code.google.com/p/ticpp/
Copyright?(c)?2006?Ryan?Pusztai?Ryan?Mulder
Permission?is?hereby?granted?free?of?charge?to?any?person?obtaining?a?copy?of
this?software?and?associated?documentation?files?(the?“Software“)?to?deal?in
the?Software?without?restriction?including?without?limitation?the?rights?to
use?copy?modify?merge?publish?distribute?sublicense?and/or?sell?copies?of
the?Software?and?to?permit?persons?to?whom?the?Software?is?furnished?to?do?so
subject?to?the?following?conditions:
The?above?copyright?notice?and?this?permission?notice?shall?be?included?in?all
copies?or?substantial?portions?of?the?Software.
THE?SOFTWARE?IS?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF?ANY?KIND?EXPRESS?OR
IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO?THE?WARRANTIES?OF?MERCHANTABILITY?FITNESS
FOR?A?PARTICULAR?PURPOSE?AND?NONINFRINGEMENT.?IN?NO?EVENT?SHALL?THE?AUTHORS?OR
COPYRIGHT?HOLDERS?BE?LIABLE?FOR?ANY?CLAIM?DAMAGES?OR?OTHER?LIABILITY?WHETHER
IN?AN?ACTION?OF?CONTRACT?TORT?OR?OTHERWISE?ARISING?FROM?OUT?OF?OR?IN
CONNECTION?WITH?THE?SOFTWARE?OR?THE?USE?OR?OTHER?DEALINGS?IN?THE?SOFTWARE.
*/
#ifdef?TIxml_USE_TICPP
#include?“ticpp.h“
#include?“ticpprc.h“
#include?“tinyxml.h“
#include?
using?namespace?ticpp;
//?In?the?following?Visitor?functions?casting?away?const?should?be?safe?as?the?object?can?only?be?referred?to?by?a?const?&
bool?Visitor::VisitEnter(?const?TixmlDocument&?doc?)
{
return?VisitEnter(?Document(?const_castlDocument*?>(?&doc?)?)?);
}
bool?Visitor::VisitExit(?const?TixmlDocument&?doc?)
{
return?VisitEnter(?Document(?const_castlDocument*?>(?&doc?)?)?);
}
bool?Visitor::VisitEnter(?const?TixmlElement&?element?const?TixmlAttribute*?firstAttribute?)
{
if?(?0?!=?firstAttribute?)
{
Attribute?attribute(?const_castlAttribute*?>(?firstAttribute?)?);
return?VisitEnter(?Element(?const_castlElement*?>(?&element?)?)?&attribute?);
}
else
{
return?VisitEnter(?Element(?const_castlElement*?>(?&element?)?)?0?);
}
}
bool?Visitor::VisitExit(?const?TixmlElement&?element?)
{
return?VisitExit(?Element(?const_castlElement*?>(?&element?)?)?);
}
bool?Visitor::Visit(?const?TixmlDeclaration&?declaration?)
{
return?Visit(?Declaration(?const_castlDeclaration*?>(?&declaration?)?)?);
}
bool?Visitor::Visit(?const?TixmlstylesheetReference&?stylesheet?)
{
return?Visit(?stylesheetReference(?const_castlstylesheetReference*?>(?&stylesheet?)?)?);
}
bool?Visitor::Visit(?const?TixmlText&?text?)
{
return?Visit(?Text(?const_castlText*?>(?&text?)?)?);
}
bool?Visitor::Visit(?const?TixmlComment&?comment?)
{
return?Visit(?Comment(?const_castlComment*?>(?&comment?)?)?);
}
Attribute::Attribute()
{
SetTixmlPointer(?new?TixmlAttribute()?);
m_impRC->InitRef();
}
Attribute::Attribute(?TixmlAttribute*?attribute?)
{
SetTixmlPointer(?attribute?);
m_impRC->IncRef();
}
Attribute::Attribute(?cons
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1764??2009-05-22?11:26??ticpp\.svn\all-wcprops
?????文件?????????62??2009-05-22?11:26??ticpp\.svn\dir-prop-ba
?????文件???????3244??2009-05-22?11:26??ticpp\.svn\entries
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????文件?????????34??2009-05-22?11:26??ticpp\.svn\prop-ba
?????目錄??????????0??2009-05-22?11:26??ticpp\.svn\prop-ba
?????目錄??????????0??2009-05-22?11:26??ticpp\.svn\props
?????文件???????2673??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件??????13546??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件??????50635??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件???????1707??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件???????1823??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件??????19869??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件??????25145??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件??????49829??2009-05-22?11:26??ticpp\.svn\text-ba
?????文件???????4536??2009-05-22?11:26??ticpp\.svn\text-ba
............此處省略61個文件信息
- 上一篇:MFC畫直線及簡單圖形
- 下一篇:MFC做的計算三角形面積
評論
共有 條評論