Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:18:57

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