Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:17:23

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