• 大小: 1.66MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-31
  • 语言: C/C++
  • 标签: xml  c++类  

资源简介

尝试了许多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_cast< TixmlDocument* >( &doc ) ) );
}

bool Visitor::VisitExit( const TixmlDocument& doc )
{
return VisitEnter( Document( const_cast< TixmlDocument* >( &doc ) ) );
}

bool Visitor::VisitEnter( const TixmlElement& element const TixmlAttribute* firstAttribute )
{
if ( 0 != firstAttribute )
{
Attribute attribute( const_cast< TixmlAttribute* >( firstAttribute ) );
return VisitEnter( Element( const_cast< TixmlElement* >( &element ) ) &attribute );
}
else
{
return VisitEnter( Element( const_cast< TixmlElement* >( &element ) ) 0 );
}
}

bool Visitor::VisitExit( const TixmlElement& element )
{
return VisitExit( Element( const_cast< TixmlElement* >( &element ) ) );
}

bool Visitor::Visit( const TixmlDeclaration& declaration )
{
return Visit( Declaration( const_cast< TixmlDeclaration* >( &declaration ) ) );
}

bool Visitor::Visit( const TixmlstylesheetReference& stylesheet )
{
return Visit( stylesheetReference( const_cast< TixmlstylesheetReference* >( &stylesheet ) ) );
}

bool Visitor::Visit( const TixmlText& text )
{
return Visit( Text( const_cast< TixmlText* >( &text ) ) );
}

bool Visitor::Visit( const TixmlComment& comment )
{
return Visit( Comment( const_cast< TixmlComment* >( &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-base

     文件       3244  2009-05-22 11:26  ticpp\.svn\entries

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\build_instructions.txt.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\changes.txt.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\dox.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\premake.lua.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\readme.txt.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\ticpp.cpp.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\ticpp.h.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\ticpprc.h.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tinystr.cpp.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tinystr.h.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tinyxml.cpp.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tinyxml.h.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tinyxmlerror.cpp.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tinyxmlparser.cpp.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tutorial_gettingStarted.txt.svn-base

     文件         34  2009-05-22 11:26  ticpp\.svn\prop-base\tutorial_ticpp.txt.svn-base

     目录          0  2009-05-22 11:26  ticpp\.svn\prop-base

     目录          0  2009-05-22 11:26  ticpp\.svn\props

     文件       2673  2009-05-22 11:26  ticpp\.svn\text-base\build_instructions.txt.svn-base

     文件      13546  2009-05-22 11:26  ticpp\.svn\text-base\changes.txt.svn-base

     文件      50635  2009-05-22 11:26  ticpp\.svn\text-base\dox.svn-base

     文件       1707  2009-05-22 11:26  ticpp\.svn\text-base\premake.lua.svn-base

     文件       1823  2009-05-22 11:26  ticpp\.svn\text-base\premake4.lua.svn-base

     文件      19869  2009-05-22 11:26  ticpp\.svn\text-base\readme.txt.svn-base

     文件      25145  2009-05-22 11:26  ticpp\.svn\text-base\ticpp.cpp.svn-base

     文件      49829  2009-05-22 11:26  ticpp\.svn\text-base\ticpp.h.svn-base

     文件       4536  2009-05-22 11:26  ticpp\.svn\text-base\ticpp.lua.svn-base

............此处省略61个文件信息

评论

共有 条评论