Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:19:27

0001 // Created on: 2007-07-31
0002 // Created by: Sergey ZARITCHNY
0003 // Copyright (c) 2007-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 _TDataStd_AsciiString_HeaderFile
0017 #define _TDataStd_AsciiString_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <TCollection_AsciiString.hxx>
0022 #include <TDF_Attribute.hxx>
0023 #include <Standard_OStream.hxx>
0024 #include <Standard_GUID.hxx>
0025 
0026 class TDF_Label;
0027 class TDF_RelocationTable;
0028 
0029 //! Used to define an AsciiString attribute containing a TCollection_AsciiString
0030 class TDataStd_AsciiString : public TDF_Attribute
0031 {
0032 
0033 public:
0034   //! class methods
0035   //! =============
0036   //! Returns the GUID of the attribute.
0037   Standard_EXPORT static const Standard_GUID& GetID();
0038 
0039   //! Finds, or creates an AsciiString attribute and sets the string.
0040   //! the AsciiString attribute is returned.
0041   //! AsciiString methods
0042   //! ===================
0043   Standard_EXPORT static occ::handle<TDataStd_AsciiString> Set(
0044     const TDF_Label&               label,
0045     const TCollection_AsciiString& string);
0046 
0047   //! Finds, or creates, an AsciiString attribute with explicit user defined <guid> and sets
0048   //! <string>. The Name attribute is returned.
0049   Standard_EXPORT static occ::handle<TDataStd_AsciiString> Set(
0050     const TDF_Label&               label,
0051     const Standard_GUID&           guid,
0052     const TCollection_AsciiString& string);
0053 
0054   Standard_EXPORT TDataStd_AsciiString();
0055 
0056   Standard_EXPORT void Set(const TCollection_AsciiString& S);
0057 
0058   //! Sets the explicit user defined GUID to the attribute.
0059   Standard_EXPORT void SetID(const Standard_GUID& guid) override;
0060 
0061   //! Sets default GUID for the attribute.
0062   Standard_EXPORT void SetID() override;
0063 
0064   Standard_EXPORT const TCollection_AsciiString& Get() const;
0065 
0066   Standard_EXPORT bool IsEmpty() const;
0067 
0068   Standard_EXPORT const Standard_GUID& ID() const override;
0069 
0070   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& with) override;
0071 
0072   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0073 
0074   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       into,
0075                              const occ::handle<TDF_RelocationTable>& RT) const override;
0076 
0077   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0078 
0079   //! Dumps the content of me into the stream
0080   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0081 
0082   DEFINE_STANDARD_RTTIEXT(TDataStd_AsciiString, TDF_Attribute)
0083 
0084 private:
0085   TCollection_AsciiString myString;
0086   Standard_GUID           myID;
0087 };
0088 
0089 #endif // _TDataStd_AsciiString_HeaderFile