Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:12

0001 // Created on: 2001-06-28
0002 // Created by: Alexander GRIGORIEV
0003 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef LDOM_XmlWriter_HeaderFile
0017 #define LDOM_XmlWriter_HeaderFile
0018 
0019 #include <Standard_OStream.hxx>
0020 #include <Standard_TypeDef.hxx>
0021 
0022 class LDOM_Document;
0023 class LDOM_Node;
0024 class LDOMBasicString;
0025 
0026 class LDOM_XmlWriter
0027 {
0028 public:
0029 
0030   Standard_EXPORT LDOM_XmlWriter (const char* theEncoding = NULL);
0031   
0032   Standard_EXPORT ~LDOM_XmlWriter ();
0033 
0034   // Set indentation for output (by default 0)
0035   void SetIndentation (const Standard_Integer theIndent) { myIndent = theIndent; }
0036 
0037   Standard_EXPORT void Write (Standard_OStream& theOStream, const LDOM_Document& theDoc);
0038 
0039   //  Stream out a DOM node, and, recursively, all of its children. This
0040   //  function is the heart of writing a DOM tree out as XML source. Give it
0041   //  a document node and it will do the whole thing.
0042   Standard_EXPORT void Write (Standard_OStream& theOStream, const LDOM_Node& theNode);
0043 
0044 private:
0045 
0046   LDOM_XmlWriter (const LDOM_XmlWriter& anOther);
0047 
0048   LDOM_XmlWriter& operator = (const LDOM_XmlWriter& anOther);
0049   
0050   void Write (Standard_OStream& theOStream, const LDOMBasicString& theString);
0051   void Write (Standard_OStream& theOStream, const char* theString); 
0052   void Write (Standard_OStream& theOStream, const char theChar);
0053 
0054   void  WriteAttribute (Standard_OStream& theOStream, const LDOM_Node& theAtt);
0055 
0056  private:
0057 
0058   char*            myEncodingName;
0059   Standard_Integer myIndent;
0060   Standard_Integer myCurIndent;
0061   char*            myABuffer;
0062   Standard_Integer myABufferLen;
0063 };
0064 
0065 #endif