Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-11-03
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _PCDM_StorageDriver_HeaderFile
0018 #define _PCDM_StorageDriver_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TCollection_ExtendedString.hxx>
0024 #include <PCDM_StoreStatus.hxx>
0025 #include <PCDM_Writer.hxx>
0026 #include <PCDM_SequenceOfDocument.hxx>
0027 class PCDM_Document;
0028 class CDM_Document;
0029 
0030 
0031 class PCDM_StorageDriver;
0032 DEFINE_STANDARD_HANDLE(PCDM_StorageDriver, PCDM_Writer)
0033 
0034 //! persistent implementation of storage.
0035 //!
0036 //! The  application  must redefine one the two Make()
0037 //! methods.  The first one, if  the application wants to
0038 //! put only one document in the storage file.
0039 //!
0040 //! The  second  method  should  be   redefined  to  put
0041 //! additional document  that   could  be  used by   the
0042 //! retrieval instead of the principal document, depending
0043 //! on the schema used during the retrieval.  For example,
0044 //! a    second     document   could   be     a   standard
0045 //! CDMShape_Document.    This  means   that a   client
0046 //! application will already be able to extract a CDMShape_Document
0047 //! of the file, if the Shape Schema remains unchanged.
0048 class PCDM_StorageDriver : public PCDM_Writer
0049 {
0050 
0051 public:
0052 
0053   
0054   //! raises NotImplemented.
0055   Standard_EXPORT virtual Handle(PCDM_Document) Make (const Handle(CDM_Document)& aDocument);
0056   
0057   //! By default, puts  in the Sequence the  document returns
0058   //! by the previous Make method.
0059   Standard_EXPORT virtual void Make (const Handle(CDM_Document)& aDocument, PCDM_SequenceOfDocument& Documents);
0060   
0061   //! Warning! raises DriverError if an error occurs during inside the
0062   //! Make method.
0063   //! stores the content of the Document into a new file.
0064   //!
0065   //! by  default  Write will  use Make   method to build a persistent
0066   //! document and the Schema method to write the persistent document.
0067   Standard_EXPORT virtual void Write (const Handle(CDM_Document)& aDocument, 
0068                                       const TCollection_ExtendedString& aFileName, 
0069                                       const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0070 
0071   //! Write <theDocument> to theOStream
0072   Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, 
0073                                       Standard_OStream& theOStream,
0074                                       const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0075   
0076   Standard_EXPORT void SetFormat (const TCollection_ExtendedString& aformat);
0077   
0078   Standard_EXPORT TCollection_ExtendedString GetFormat() const;
0079   
0080   Standard_EXPORT Standard_Boolean IsError() const;
0081   
0082   Standard_EXPORT void SetIsError (const Standard_Boolean theIsError);
0083   
0084   Standard_EXPORT PCDM_StoreStatus GetStoreStatus() const;
0085   
0086   Standard_EXPORT void SetStoreStatus (const PCDM_StoreStatus theStoreStatus);
0087 
0088 
0089 
0090 
0091   DEFINE_STANDARD_RTTIEXT(PCDM_StorageDriver,PCDM_Writer)
0092 
0093 protected:
0094 
0095 
0096 
0097 
0098 private:
0099 
0100 
0101   TCollection_ExtendedString myFormat;
0102   Standard_Boolean myIsError;
0103   PCDM_StoreStatus myStoreStatus;
0104 
0105 
0106 };
0107 
0108 
0109 
0110 
0111 
0112 
0113 
0114 #endif // _PCDM_StorageDriver_HeaderFile