Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2020 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 #ifndef _TDataStd_GenericExtString_HeaderFile
0015 #define _TDataStd_GenericExtString_HeaderFile
0016 
0017 #include <TDF_DerivedAttribute.hxx>
0018 #include <TCollection_ExtendedString.hxx>
0019 #include <Standard_GUID.hxx>
0020 
0021 class TDF_RelocationTable;
0022 
0023 class TDataStd_GenericExtString;
0024 DEFINE_STANDARD_HANDLE(TDataStd_GenericExtString, TDF_Attribute)
0025 
0026 //! An ancestor attribute for all attributes which have TCollection_ExtendedString field.
0027 //! If an attribute inherits this one it should not have drivers for persistence.
0028 //! Also this attribute provides functionality to have on the same label same attributes with different IDs.
0029 class TDataStd_GenericExtString : public TDF_Attribute
0030 {
0031 
0032 public:
0033 
0034   //! Sets <S> as name. Raises if <S> is not a valid name.
0035   Standard_EXPORT virtual void Set (const TCollection_ExtendedString& S);
0036   
0037   //! Sets the explicit user defined GUID  to the attribute.
0038   Standard_EXPORT void SetID (const Standard_GUID& guid) Standard_OVERRIDE;
0039 
0040   //! Returns the name contained in this name attribute.
0041   Standard_EXPORT virtual const TCollection_ExtendedString& Get() const;
0042   
0043   //! Returns the ID of the attribute.
0044   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0045 
0046   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
0047 
0048   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
0049 
0050   //! Dumps the content of me into the stream
0051   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0052 
0053   DEFINE_STANDARD_RTTIEXT(TDataStd_GenericExtString,TDF_Attribute)
0054 
0055 protected:
0056   //! A string field of the attribute, participated in persistence.
0057   TCollection_ExtendedString myString;
0058   //! A private GUID of the attribute.
0059   Standard_GUID myID;
0060 
0061 };
0062 
0063 #endif // _TDataStd_GenericExtString_HeaderFile