1 // Created on: 2001-06-28
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef LDOM_XmlWriter_HeaderFile
17 #define LDOM_XmlWriter_HeaderFile
19 #include <Standard_OStream.hxx>
20 #include <Standard_TypeDef.hxx>
25 class LDOMBasicString;
31 Standard_EXPORT LDOM_XmlWriter (const char* theEncoding = NULL);
33 Standard_EXPORT ~LDOM_XmlWriter ();
35 // Set indentation for output (by default 0)
36 void SetIndentation (const Standard_Integer theIndent) { myIndent = theIndent; }
38 Standard_EXPORT void Write (Standard_OStream& theOStream, const LDOM_Document& theDoc);
40 // Stream out a DOM node, and, recursively, all of its children. This
41 // function is the heart of writing a DOM tree out as XML source. Give it
42 // a document node and it will do the whole thing.
43 Standard_EXPORT void Write (Standard_OStream& theOStream, const LDOM_Node& theNode);
47 LDOM_XmlWriter (const LDOM_XmlWriter& anOther);
49 LDOM_XmlWriter& operator = (const LDOM_XmlWriter& anOther);
51 void Write (Standard_OStream& theOStream, const LDOMBasicString& theString);
52 void Write (Standard_OStream& theOStream, const char* theString);
53 void Write (Standard_OStream& theOStream, const char theChar);
55 void WriteAttribute (Standard_OStream& theOStream, const LDOM_Node& theAtt);
60 Standard_Integer myIndent;
61 Standard_Integer myCurIndent;
63 Standard_Integer myABufferLen;