本文整理汇总了C++中TiXmlString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ TiXmlString::length方法的具体用法?C++ TiXmlString::length怎么用?C++ TiXmlString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiXmlString
的用法示例。
在下文中一共展示了TiXmlString::length方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
{
TiXmlString tmp;
tmp.reserve(a.length() + b.length());
tmp += a;
tmp += b;
return tmp;
}
示例2: sizeof
// TiXmlString copy constructor
TiXmlString::TiXmlString (const TiXmlString& copy)
{
unsigned newlen;
WCHAR * newstring;
// Prevent copy to self!
if ( © == this )
return;
if (! copy.allocated)
{
allocated = 0;
cstring = NULL;
current_length = 0;
return;
}
newlen = copy.length () + 1;
newstring = new WCHAR [newlen];
// strcpy (newstring, copy.cstring);
CopyMemory(newstring, copy.cstring, sizeof(WCHAR)*newlen);
allocated = newlen;
cstring = newstring;
current_length = newlen - 1;
}
示例3: if
bool TiXmlString::operator == (const TiXmlString & compare) const
{
if ( allocated && compare.allocated )
{
assert( cstring );
assert( compare.cstring );
return ( strcmp( cstring, compare.cstring ) == 0 );
}
else if ( length() == 0 && compare.length() == 0 )
{
return true;
}
return false;
}
示例4: length
// TiXmlString copy constructor
TiXmlString ( const TiXmlString & copy) : rep_(0)
{
init(copy.length());
memcpy(start(), copy.data(), length());
}
示例5: strcmp
inline bool operator == (const TiXmlString & a, const TiXmlString & b)
{
return ( a.length() == b.length() ) // optimization on some platforms
&& ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
}