Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:59

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_HString_HeaderFile
0016 #define _StdLPersistent_HString_HeaderFile
0017 
0018 #include <StdObjMgt_Persistent.hxx>
0019 
0020 #include <Standard_TypeDef.hxx>
0021 #include <TCollection_HAsciiString.hxx>
0022 #include <TCollection_HExtendedString.hxx>
0023 
0024 
0025 class StdLPersistent_HString
0026 {
0027   template <class StringClass, typename CharType>
0028   class instance : public StdObjMgt_Persistent
0029   {
0030   public:
0031     //! Read persistent data from a file.
0032     Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData);
0033     //! Write persistent data to a file.
0034     Standard_EXPORT virtual void Write (StdObjMgt_WriteData& theWriteData) const;
0035     virtual void PChildren(StdObjMgt_Persistent::SequenceOfPersistent&) const { }
0036 
0037     //! Get/create a label defined by referenced string.
0038     Standard_EXPORT virtual TDF_Label Label (const Handle(TDF_Data)& theDF) const;
0039 
0040     //! Get the value.
0041     const Handle(StringClass)& Value() const  { return myValue; }
0042 
0043   protected:
0044     Handle(StringClass) myValue;
0045   };
0046 
0047 public:
0048   class Ascii
0049     : public instance<TCollection_HAsciiString, Standard_Character>
0050   {
0051   public:
0052     //! Get referenced ASCII string.
0053     Standard_EXPORT virtual Handle(TCollection_HAsciiString) AsciiString() const;
0054 
0055     inline Standard_CString PName() const { return "PCollection_HAsciiString"; }
0056   };
0057 
0058   class Extended
0059     : public instance<TCollection_HExtendedString, Standard_ExtCharacter>
0060   {
0061   public:
0062     //! Get referenced extended string.
0063     Standard_EXPORT virtual Handle(TCollection_HExtendedString) ExtString() const;
0064 
0065     inline Standard_CString PName() const { return "PCollection_HExtendedString"; }
0066   };
0067 };
0068 
0069 #endif