Menu

#139 XMLPrinter::ClearBuffer() resets _firstElement

open
nobody
None
5
2019-03-05
2019-03-05
No

XMLPrinter::ClearBuffer sets _ firstElement to true. That leads to the suppression of linebreaks in successive uses of XMLPrinter.

This is relevant when buffering the output of XMLPrinter. In detail: The only way to make XMLPrinter write to an std::ostream while not keeping the entire document in memory is to regularly flush the contents of XMLPrinter::CStr() to the ostream - even when only halfway through the document - followed by a call to XMLPrinter::ClearBuffer().

The solution is to remove the line setting "firstElement = true" in XMLPrinter::ClearBuffer. I'm happy to provide a pull request if you point me to where I can do that.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.