1 // Copyright (c) 2020 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _TDataStd_GenericExtString_HeaderFile
15 #define _TDataStd_GenericExtString_HeaderFile
17 #include <TDF_DerivedAttribute.hxx>
18 #include <TCollection_ExtendedString.hxx>
19 #include <Standard_GUID.hxx>
21 class TDF_RelocationTable;
23 class TDataStd_GenericExtString;
24 DEFINE_STANDARD_HANDLE(TDataStd_GenericExtString, TDF_Attribute)
26 //! An ancestor attribute for all attributes which have TCollection_ExtendedString field.
27 //! If an attribute inherits this one it should not have drivers for persistence.
28 //! Also this attribute provides functionality to have on the same label same attributes with different IDs.
29 class TDataStd_GenericExtString : public TDF_Attribute
34 //! Sets <S> as name. Raises if <S> is not a valid name.
35 Standard_EXPORT virtual void Set (const TCollection_ExtendedString& S);
37 //! Sets the explicit user defined GUID to the attribute.
38 Standard_EXPORT void SetID (const Standard_GUID& guid) Standard_OVERRIDE;
40 //! Returns the name contained in this name attribute.
41 Standard_EXPORT virtual const TCollection_ExtendedString& Get() const;
43 //! Returns the ID of the attribute.
44 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
46 Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
48 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
50 //! Dumps the content of me into the stream
51 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
53 DEFINE_STANDARD_RTTIEXT(TDataStd_GenericExtString,TDF_Attribute)
56 //! A string field of the attribute, participated in persistence.
57 TCollection_ExtendedString myString;
58 //! A private GUID of the attribute.
63 #endif // _TDataStd_GenericExtString_HeaderFile