
From: John Torjo <john.lists@torjo.com>
Vladimir Prus wrote:
John Torjo wrote:
// write XML std::cout << formatob(vp, containerfmt("<elem> % </elem><elem> % </elem>",
And how do you know what to output if there's only one element?
Basically this is just a simper interface for the user. The decorator will parse the string, which in the above case means:
- open: "<elem> " - seq : " </elem><elem> " - close: " </elem>"
BTW, that parsing can be to simply replace "%" with \0 and tracking the pointers to the start of each piece. Thus, no copying is needed.
But to the human eye, it's much easier to understand: "<elem> % </elem><elem> % </elem>"
than "<elem> "," </elem><elem> "," </elem>"
Agreed, but pipes ("|") are easier to grok: "<elem> | </elem><elem> | </elem>" -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;