Hopefully simple request for the XmlElement class: Can we have a toString() method that returns the whole element (with sub elements) as a String? This would be extremely helpful while debugging. It would be even better if it was “pretty printed.”
thanks,
c.
already there! except it’s called “createDocument”
I tend to use a macro for debugging XML content at various points to make it easier. Something like this…
#ifdef JUCE_DEBUG
#define DBGXML(xml,msg) DBG(msg);\
DBG(xml->createDocument(String::empty,false,false));
#else
#define DBGXML(xml,msg)
#endif
… then you can just put DBGXML(pXmlElement,T(“some reminder of what you’re testing”)); and it will be filtered out in a release build. [mind you, the DBGs would be filtered out anyway, so you probably don’t need to bother putting it in preprocessor conditionals. I think the one i used was actually a little different, but this is basically the same.
this was from memory though, it might not work out of the tin!
1 Like