size of XMLtext?
Hi lee thanks for merging the update that I done. Im working on cocos2dx atm which uses tiny xml for its windows 8 platform.
Here is a function in the code
bool XmlSaxHander::Visit( const XMLText& text ) {
//CCLog("Visit %s",text.Value());
CCSAXParser::textHandler(m_ccsaxParserImp, (const CC_XML_CHAR *)text.Value(), text.ValueTStr().size());
return true;
}
now my issue is tinyxml2 doesnt have a .ValueTStr().size() function.
Any hints?
If you just want to get the length of the text, you can use strlen( text.Value() ), because text.Value() just return a '\0' terminated char pointer.
It would be straightforward to have method on StrPair (which in the underlying string class):
StrPair.Size() { GetStr(); return end-str; }
The GetStr() is just there to cause a flush.
The tedious part is this, in the API surface:
const char* Value()
int ValueSize();
or possibly:
const char* Value( int* size=0 );
Which is possibly a little better. Thoughts on whether that is a valuable API? (It's come up before.)
const char* Value( int* size=0 ); +1
+1 from me also Sorry for the late reply.
I got tinyxml2 working with cocos in an hour or so today in my free time