Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:00

0001 // Copyright (c) 2015 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 
0015 #ifndef _StdLPersistent_XLink_HeaderFile
0016 #define _StdLPersistent_XLink_HeaderFile
0017 
0018 #include <StdObjMgt_Attribute.hxx>
0019 #include <StdLPersistent_HString.hxx>
0020 
0021 #include <TDocStd_XLink.hxx>
0022 
0023 
0024 class StdLPersistent_XLink : public StdObjMgt_Attribute<TDocStd_XLink>
0025 {
0026 public:
0027   //! Read persistent data from a file.
0028   inline void Read (StdObjMgt_ReadData& theReadData)
0029     { theReadData >> myDocEntry >> myLabEntry; }
0030   //! Write persistent data to a file.
0031   inline void Write (StdObjMgt_WriteData& theWriteData) const
0032     { theWriteData << myDocEntry << myLabEntry; }
0033   //! Gets persistent child objects
0034   inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0035   {
0036     theChildren.Append(myDocEntry);
0037     theChildren.Append(myLabEntry);
0038   }
0039   //! Returns persistent type name
0040   inline Standard_CString PName() const { return "PDocStd_XLink"; }
0041 
0042   //! Import transient attribute from the persistent data.
0043   void Import (const Handle(TDocStd_XLink)& theAttribute) const
0044   {
0045     if (myDocEntry)
0046       theAttribute->DocumentEntry (myDocEntry->Value()->String());
0047 
0048     if (myLabEntry)
0049       theAttribute->LabelEntry    (myLabEntry->Value()->String());
0050   }
0051 
0052 private:
0053   Handle(StdLPersistent_HString::Ascii) myDocEntry;
0054   Handle(StdLPersistent_HString::Ascii) myLabEntry;
0055 };
0056 
0057 #endif