Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:20:46

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()
0036       : myPtrDoc(nullptr)
0037   {
0038   }
0039 
0040   //    Empty constructor
0041 
0042   LDOMString(const LDOMString& anOther)
0043 
0044     = default;
0045 
0046   //    Copy constructor
0047 
0048   LDOMString(const int aValue)
0049       : LDOMBasicString(aValue),
0050         myPtrDoc(nullptr)
0051   {
0052   }
0053 
0054   //    Integer => LDOMString
0055 
0056   //  Standard_EXPORT LDOMString (const double aValue);
0057 
0058   LDOMString(const char* aValue)
0059       : LDOMBasicString(aValue),
0060         myPtrDoc(nullptr)
0061   {
0062   }
0063 
0064   //    Create LDOM_AsciiFree
0065 
0066   const LDOM_MemManager& getOwnerDocument() const { return *myPtrDoc; }
0067 
0068   LDOMString& operator=(const LDOM_NullPtr* aNull)
0069   {
0070     LDOMBasicString::operator=(aNull);
0071     return *this;
0072   }
0073 
0074   LDOMString& operator=(const LDOMString& anOther) = default;
0075 
0076 private:
0077   friend class LDOM_Document;
0078   friend class LDOM_Node;
0079   friend class LDOM_Element;
0080   friend class LDOM_BasicElement;
0081   friend class LDOM_BasicAttribute;
0082   friend class LDOM_BasicText;
0083 
0084   static LDOMString CreateDirectString(const char* aValue, const LDOM_MemManager& aDoc);
0085 
0086   LDOMString(const LDOMBasicString& anOther, const LDOM_MemManager& aDoc)
0087       : LDOMBasicString(anOther),
0088         myPtrDoc(&aDoc)
0089   {
0090   }
0091 
0092   //    Plain copy from LDOMBasicString
0093 
0094   LDOMString(const LDOMBasicString& anOther, const occ::handle<LDOM_MemManager>& aDoc);
0095   //    Copy from another string with allocation in the document space
0096 
0097 private:
0098   // ---------- PRIVATE FIELDS -------------
0099   const LDOM_MemManager* myPtrDoc;
0100 };
0101 
0102 #endif