資源簡介
tinyXML解析實例源碼,有了這個解析XML各種方便

代碼片段和文件信息
/*
www.sourceforge.net/projects/tinyxml
This?software?is?provided?‘as-is‘?without?any?express?or?implied
warranty.?In?no?event?will?the?authors?be?held?liable?for?any
damages?arising?from?the?use?of?this?software.
Permission?is?granted?to?anyone?to?use?this?software?for?any
purpose?including?commercial?applications?and?to?alter?it?and
redistribute?it?freely?subject?to?the?following?restrictions:
1.?The?origin?of?this?software?must?not?be?misrepresented;?you?must
not?claim?that?you?wrote?the?original?software.?If?you?use?this
software?in?a?product?an?acknowledgment?in?the?product?documentation
would?be?appreciated?but?is?not?required.
2.?Altered?source?versions?must?be?plainly?marked?as?such?and
must?not?be?misrepresented?as?being?the?original?software.
3.?This?notice?may?not?be?removed?or?altered?from?any?source
distribution.
*/
#ifndef?TIxml_USE_STL
#include?“tinystr.h“
//?Error?value?for?find?primitive
const?TixmlString::size_type?TixmlString::npos?=?static_castlString::size_type?>(-1);
//?Null?rep.
TixmlString::Rep?TixmlString::nullrep_?=?{?0?0?{?‘\0‘?}?};
void?TixmlString::reserve?(size_type?cap)
{
if?(cap?>?capacity())
{
TixmlString?tmp;
tmp.init(length()?cap);
memcpy(tmp.start()?data()?length());
swap(tmp);
}
}
TixmlString&?TixmlString::assign(const?char*?str?size_type?len)
{
size_type?cap?=?capacity();
if?(len?>?cap?||?cap?>?3*(len?+?8))
{
TixmlString?tmp;
tmp.init(len);
memcpy(tmp.start()?str?len);
swap(tmp);
}
else
{
memmove(start()?str?len);
set_size(len);
}
return?*this;
}
TixmlString&?TixmlString::append(const?char*?str?size_type?len)
{
size_type?newsize?=?length()?+?len;
if?(newsize?>?capacity())
{
reserve?(newsize?+?capacity());
}
memmove(finish()?str?len);
set_size(newsize);
return?*this;
}
TixmlString?operator?+?(const?TixmlString?&?a?const?TixmlString?&?b)
{
TixmlString?tmp;
tmp.reserve(a.length()?+?b.length());
tmp?+=?a;
tmp?+=?b;
return?tmp;
}
TixmlString?operator?+?(const?TixmlString?&?a?const?char*?b)
{
TixmlString?tmp;
TixmlString::size_type?b_len?=?static_castlString::size_type>(?strlen(b)?);
tmp.reserve(a.length()?+?b_len);
tmp?+=?a;
tmp.append(b?b_len);
return?tmp;
}
TixmlString?operator?+?(const?char*?a?const?TixmlString?&?b)
{
TixmlString?tmp;
TixmlString::size_type?a_len?=?static_castlString::size_type>(?strlen(a)?);
tmp.reserve(a_len?+?b.length());
tmp.append(a?a_len);
tmp?+=?b;
return?tmp;
}
#endif //?TIxml_USE_STL
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????48??2012-03-09?10:20??test5.xm
?????文件?????????72??2012-03-09?10:20??test6.xm
?????文件????????134??2012-03-09?10:20??test7.xm
?????文件????????690??2011-05-14?19:24??utf8test.xm
?????文件????????703??2012-03-09?10:20??utf8testout.xm
?????文件????????692??2011-05-14?19:24??utf8testverify.xm
?????文件????????157??2012-03-09?10:20??textfile.txt
?????文件???????8198??2011-05-14?19:24??tinystr.h
?????文件??????64834??2011-05-14?19:24??tinyxm
?????文件???????2507??2011-05-14?19:24??tinystr.cpp
?????文件??????37591??2011-05-14?19:24??tinyxm
?????文件???????1791??2011-05-14?19:24??tinyxm
?????文件??????37242??2011-05-14?19:24??tinyxm
?????文件??????42583??2012-03-09?10:20??xm
?????文件???????4304??2012-03-09?10:19??testxm
?????文件????????360??2012-03-09?10:20??demotest.xm
-----------?---------??----------?-----??----
???????????????201906????????????????????16
- 上一篇:Nexys4-DDR簡介.pdf
- 下一篇:區域生長法
評論
共有 條評論