Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2017 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 _StdStorage_HeaderData_HeaderFile
0015 #define _StdStorage_HeaderData_HeaderFile
0016 
0017 #include <Standard.hxx>
0018 #include <Standard_Type.hxx>
0019 
0020 #include <Standard_Integer.hxx>
0021 #include <TColStd_SequenceOfAsciiString.hxx>
0022 #include <TColStd_SequenceOfExtendedString.hxx>
0023 #include <Storage_Error.hxx>
0024 #include <Standard_Transient.hxx>
0025 class Storage_BaseDriver;
0026 
0027 class StdStorage_HeaderData;
0028 DEFINE_STANDARD_HANDLE(StdStorage_HeaderData, Standard_Transient)
0029 
0030 //! Storage header data section that contains some
0031 //! auxiliary information (application name, schema version,
0032 //! creation date, comments and so on...)
0033 class StdStorage_HeaderData 
0034   : public Standard_Transient
0035 {
0036   friend class StdStorage_Data;
0037 
0038 public:
0039 
0040   DEFINE_STANDARD_RTTIEXT(StdStorage_HeaderData, Standard_Transient)
0041 
0042   //! Reads the header data section from the container defined by theDriver. 
0043   //! Returns Standard_True in case of success. Otherwise, one need to get 
0044   //! an error code and description using ErrorStatus and ErrorStatusExtension
0045   //! functions correspondingly.
0046   Standard_EXPORT Standard_Boolean Read(const Handle(Storage_BaseDriver)& theDriver);
0047 
0048   //! Writes the header data section to the container defined by theDriver. 
0049   //! Returns Standard_True in case of success. Otherwise, one need to get 
0050   //! an error code and description using ErrorStatus and ErrorStatusExtension
0051   //! functions correspondingly.
0052   Standard_EXPORT Standard_Boolean Write(const Handle(Storage_BaseDriver)& theDriver);
0053 
0054   //! Return the creation date
0055   Standard_EXPORT TCollection_AsciiString CreationDate() const;
0056 
0057   //! Return the Storage package version
0058   Standard_EXPORT TCollection_AsciiString StorageVersion() const;
0059 
0060   //! Get the version of the schema
0061   Standard_EXPORT TCollection_AsciiString SchemaVersion() const;
0062 
0063   //! Set the version of the application
0064   Standard_EXPORT void SetApplicationVersion(const TCollection_AsciiString& aVersion);
0065 
0066   //! Get the version of the application
0067   Standard_EXPORT TCollection_AsciiString ApplicationVersion() const;
0068 
0069   //! Set the name of the application
0070   Standard_EXPORT void SetApplicationName(const TCollection_ExtendedString& aName);
0071 
0072   //! Get the name of the application
0073   Standard_EXPORT TCollection_ExtendedString ApplicationName() const;
0074 
0075   //! Set the data type
0076   Standard_EXPORT void SetDataType(const TCollection_ExtendedString& aType);
0077 
0078   //! Returns data type
0079   Standard_EXPORT TCollection_ExtendedString DataType() const;
0080 
0081   //! Add <theUserInfo> to the user information
0082   Standard_EXPORT void AddToUserInfo(const TCollection_AsciiString& theUserInfo);
0083 
0084   //! Return the user information
0085   Standard_EXPORT const TColStd_SequenceOfAsciiString& UserInfo() const;
0086 
0087   //! Add <theUserInfo> to the user information
0088   Standard_EXPORT void AddToComments(const TCollection_ExtendedString& aComment);
0089 
0090   //! Return the user information
0091   Standard_EXPORT const TColStd_SequenceOfExtendedString& Comments() const;
0092 
0093   //! Returns the number of persistent objects
0094   Standard_EXPORT Standard_Integer NumberOfObjects() const;
0095 
0096   //! Returns a status of the latest call to Read / Write functions
0097   Standard_EXPORT Storage_Error ErrorStatus() const;
0098 
0099   //! Returns an error message if any of the latest call to Read / Write functions
0100   Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
0101 
0102   //! Clears error status
0103   Standard_EXPORT void ClearErrorStatus();
0104 
0105   Standard_EXPORT void SetNumberOfObjects(const Standard_Integer anObjectNumber);
0106 
0107   Standard_EXPORT void SetStorageVersion(const TCollection_AsciiString& aVersion);
0108 
0109   Standard_EXPORT void SetCreationDate(const TCollection_AsciiString& aDate);
0110 
0111   Standard_EXPORT void SetSchemaVersion(const TCollection_AsciiString& aVersion);
0112 
0113   Standard_EXPORT void SetSchemaName(const TCollection_AsciiString& aName);
0114 
0115 private:
0116 
0117   Standard_EXPORT StdStorage_HeaderData();
0118 
0119   Standard_EXPORT void SetErrorStatus(const Storage_Error anError);
0120 
0121   Standard_EXPORT void SetErrorStatusExtension(const TCollection_AsciiString& anErrorExt);
0122 
0123   Standard_Integer                 myNBObj;
0124   TCollection_AsciiString          myStorageVersion;
0125   TCollection_AsciiString          mySchemaVersion;
0126   TCollection_AsciiString          mySchemaName;
0127   TCollection_AsciiString          myApplicationVersion;
0128   TCollection_ExtendedString       myApplicationName;
0129   TCollection_ExtendedString       myDataType;
0130   TCollection_AsciiString          myDate;
0131   TColStd_SequenceOfAsciiString    myUserInfo;
0132   TColStd_SequenceOfExtendedString myComments;
0133   Storage_Error                    myErrorStatus;
0134   TCollection_AsciiString          myErrorStatusExt;
0135 
0136 };
0137 
0138 #endif // _StdStorage_HeaderData_HeaderFile