Provide finer control over indentation inside the XMLPrinter. You'll have to subclass it to override its standard behaviour by overwriting CompactMode().

This commit is contained in:
Uli Kusterer
2014-02-22 17:17:25 +01:00
2 changed files with 15 additions and 11 deletions

View File

@@ -1967,7 +1967,7 @@ public:
/** If streaming, start writing an element.
The element must be closed with CloseElement()
*/
void OpenElement( const char* name );
void OpenElement( const char* name, bool compactMode );
/// If streaming, add an attribute to an open element.
void PushAttribute( const char* name, const char* value );
void PushAttribute( const char* name, int value );
@@ -1975,7 +1975,7 @@ public:
void PushAttribute( const char* name, bool value );
void PushAttribute( const char* name, double value );
/// If streaming, close the Element.
virtual void CloseElement();
virtual void CloseElement( bool compactMode );
/// Add a text node.
void PushText( const char* text, bool cdata=false );
@@ -2034,6 +2034,8 @@ public:
}
protected:
virtual bool CompactMode( const XMLElement& elem ) { return _compactMode; };
/** Prints out the space before an element. You may override to change
the space and tabs used. A PrintSpace() override should call Print().
*/