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_TypeDef.hxx>
26 class LDOMBasicString;
32 Standard_EXPORT LDOM_XmlWriter (FILE * aFile, const char * theEncoding= NULL);
35 Standard_EXPORT ~LDOM_XmlWriter ();
38 void SetIndentation (const Standard_Integer theIndent) { myIndent=theIndent; }
39 // Set indentation for output (by default 0)
41 Standard_EXPORT LDOM_XmlWriter& operator<< (const LDOM_Document& aDoc);
43 Standard_EXPORT LDOM_XmlWriter& operator<< (const LDOM_Node& toWrite);
44 // ostream << DOM_Node
45 // Stream out a DOM node, and, recursively, all of its children. This
46 // function is the heart of writing a DOM tree out as XML source. Give it
47 // a document node and it will do the whole thing.
51 void WriteAttribute (const LDOM_Node& theAtt);
53 LDOM_XmlWriter& operator<< (const LDOMBasicString&);
54 // Stream out LDOM String
56 inline LDOM_XmlWriter& operator<< (const LXMLCh * toWrite);
57 // Stream out a character string. Doing this requires that we first transcode
58 // to char * form in the default code page for the system
60 inline LDOM_XmlWriter& operator << (const LXMLCh aChar);
62 LDOM_XmlWriter (const LDOM_XmlWriter& anOther);
63 // Copy constructor - prohibited
65 LDOM_XmlWriter& operator = (const LDOM_XmlWriter& anOther);
66 // Assignment operator - prohibited
71 LXMLCh * myEncodingName;
72 Standard_Integer myIndent;
73 Standard_Integer myCurIndent;
74 char * myABuffer; // for WriteAttribute()
75 Standard_Integer myABufferLen; // for WriteAttribute()