Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:16:14

0001 // Created on: 2001-06-26
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_BasicAttribute_HeaderFile
0017 #define LDOM_BasicAttribute_HeaderFile
0018 
0019 #include <LDOM_BasicNode.hxx>
0020 #include <LDOMBasicString.hxx>
0021 
0022 class LDOM_Attr;
0023 
0024 //  Class LDOM_BasicAttribute
0025 //
0026 
0027 class LDOM_BasicAttribute : public LDOM_BasicNode
0028 {
0029 public:
0030   // ---------- PUBLIC METHODS ----------
0031 
0032   LDOM_BasicAttribute()
0033       : LDOM_BasicNode(LDOM_Node::UNKNOWN),
0034         myName(nullptr)
0035   {
0036   }
0037 
0038   //    Empty constructor
0039 
0040   LDOM_BasicAttribute& operator=(const LDOM_NullPtr* aNull);
0041 
0042   //    Nullify
0043 
0044   const char* GetName() const { return myName; }
0045 
0046   const LDOMBasicString& GetValue() const { return myValue; }
0047 
0048   void SetValue(const LDOMBasicString& aValue, const occ::handle<LDOM_MemManager>& aDoc)
0049   {
0050     myValue = LDOMString(aValue, aDoc);
0051   }
0052 
0053 private:
0054   friend class LDOM_Node;
0055   friend class LDOM_Attr;
0056   friend class LDOM_Element;
0057   friend class LDOM_BasicElement;
0058   friend class LDOM_XmlReader;
0059 
0060   // ---------- PRIVATE METHODS ----------
0061 
0062   LDOM_BasicAttribute(const LDOMBasicString& aName)
0063       : LDOM_BasicNode(LDOM_Node::ATTRIBUTE_NODE),
0064         myName(aName.GetString())
0065   {
0066   }
0067 
0068   //    Constructor
0069 
0070   static LDOM_BasicAttribute& Create(const LDOMBasicString&              theName,
0071                                      const occ::handle<LDOM_MemManager>& theDoc,
0072                                      int&                                theHashIndex);
0073 
0074   LDOM_BasicAttribute(const LDOM_Attr& anAttr);
0075 
0076 private:
0077   // ---------- PRIVATE FIELDS ----------
0078 
0079   //  LDOMBasicString       myName;
0080   const char*     myName;
0081   LDOMBasicString myValue;
0082 };
0083 
0084 #endif