Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2001-06-25
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 LDOMString_HeaderFile
0017 #define LDOMString_HeaderFile
0018 
0019 #include <LDOMBasicString.hxx>
0020 
0021 class LDOM_MemManager;
0022 
0023 //  Class LDOMString
0024 //  Represents various object types which can be mapped to XML strings
0025 //  LDOMString is not an independent type: you must be sure that the owner
0026 //  LDOM_Document is never lost during the lifetime of its LDOMStrings - for
0027 //  that it is necessary to keep at least one LDOM_Document or LDOM_Node alive
0028 //  before all LDOMString's (LDOM_AsciiDoc type) are destroyed.
0029 
0030 class LDOMString : public LDOMBasicString
0031 {
0032  public:
0033   // ---------- PUBLIC METHODS ----------
0034 
0035   LDOMString                    () : myPtrDoc (NULL) {}
0036   //    Empty constructor
0037 
0038   LDOMString                    (const LDOMString& anOther)
0039     : LDOMBasicString (anOther), myPtrDoc (anOther.myPtrDoc) {}
0040   //    Copy constructor
0041 
0042   LDOMString                    (const Standard_Integer aValue)
0043     : LDOMBasicString (aValue), myPtrDoc (NULL) {}
0044   //    Integer => LDOMString
0045 
0046 //  Standard_EXPORT LDOMString (const Standard_Real aValue);
0047 
0048   LDOMString                    (const char * aValue)
0049     : LDOMBasicString (aValue), myPtrDoc (NULL) {}
0050   //    Create LDOM_AsciiFree
0051 
0052   const LDOM_MemManager&       getOwnerDocument  () const
0053                         { return * myPtrDoc; }
0054 
0055   LDOMString&                   operator =        (const LDOM_NullPtr * aNull)
0056                         { LDOMBasicString::operator= (aNull); return *this; }
0057 
0058   LDOMString&                   operator =        (const LDOMString& anOther)
0059   {
0060     myPtrDoc = anOther.myPtrDoc;
0061     LDOMBasicString::operator= (anOther);
0062     return * this;
0063   }
0064 
0065  private:
0066   friend class LDOM_Document;
0067   friend class LDOM_Node;
0068   friend class LDOM_Element;
0069   friend class LDOM_BasicElement;
0070   friend class LDOM_BasicAttribute;
0071   friend class LDOM_BasicText;
0072 
0073   static LDOMString CreateDirectString
0074                                 (const char             * aValue,
0075                                  const LDOM_MemManager& aDoc);
0076 
0077   LDOMString                    (const LDOMBasicString& anOther,
0078                                  const LDOM_MemManager& aDoc)
0079     : LDOMBasicString (anOther), myPtrDoc (&aDoc) {}
0080   //    Plain copy from LDOMBasicString
0081 
0082   LDOMString                    (const LDOMBasicString&         anOther,
0083                                  const Handle(LDOM_MemManager)& aDoc);
0084   //    Copy from another string with allocation in the document space
0085 
0086  private:
0087   // ---------- PRIVATE FIELDS -------------
0088   const LDOM_MemManager * myPtrDoc;
0089 };
0090 
0091 #endif