There's some way to make a partial parse??? My problem is that I am receiving the data from a socket and adding it all into a buffer... Then I call Parse passing that buffer's... but when I have 1 complete xml stream and a half of the second I think that the things will not go well...
example:
<data><a="aaaa"/><b="bbbb/></data><data><c="cccc"/>... ( and the socket stopped sending data )...
I think that the parse method could stop as soon as it detect the end of the XML ( in this case, when it sees the </data> that is the finishing root element ) and return the pointer to where it stopped reading... this way, the calling function can know and buffer that data back to wait for more data...
Anyone has suggestions ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to load xml from a memory buffer such as c++ string. I couldn't find it in tutorial neither in the code. Can anyone help?
Somehow I missed that on the tutorial. I'll add it in. Its obvious once you know:
TiXmlDocument doc;
doc.parse("<greeting>Hello</greeting>");
http://www.grinninglizard.com/tinyxmldocs/classTiXmlDocument.html#a14
There's some way to make a partial parse??? My problem is that I am receiving the data from a socket and adding it all into a buffer... Then I call Parse passing that buffer's... but when I have 1 complete xml stream and a half of the second I think that the things will not go well...
example:
<data><a="aaaa"/><b="bbbb/></data><data><c="cccc"/>... ( and the socket stopped sending data )...
I think that the parse method could stop as soon as it detect the end of the XML ( in this case, when it sees the </data> that is the finishing root element ) and return the pointer to where it stopped reading... this way, the calling function can know and buffer that data back to wait for more data...
Anyone has suggestions ?