Seeing the documentation of XmlDocument::parse(Ch*) in RapidXml, i’m left wondering about the character buffer being ‘non const’. I’m not sure how this is going to work in general when the buffer needs to grow by any such modifications of the parser. Will the library do the growing? if i am asking it to parse, it should just parse right? otherwise it ought to be called ParseAndPossibleModifyButLetMeKnowIfYouHadToRegrowTheBufferInWhichCaseHeyCheckThisFlagAndCopyThisPointer or something like that.
Am i missing something? I want to understand this library because i want something that is simple to use to open and append / edit xml files on the fly from C++, but if there are simpler / better alternatives do not hesitate to make such suggestions as answers!!
RapidXML tries its best to be an in-place parser. When it can’t, it will allocate memory (linked to the lifetime of the
xml_document<>), but only when necessary. It’s fairly rare for a string to have to actually grow due to XML reading.It will modify the contents of the string (unless you set the non-modifying flag), and its objects will keep references to that string around. So you need to make sure that the buffer survives for long enough. But other than that, there’s not much to worry about.