Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-18 08:30:20

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 class PCDM_StorageDriver;
0031 DEFINE_STANDARD_HANDLE(PCDM_StorageDriver, PCDM_Writer)
0032 
0033 //! persistent implementation of storage.
0034 //!
0035 //! The  application  must redefine one the two Make()
0036 //! methods.  The first one, if  the application wants to
0037 //! put only one document in the storage file.
0038 //!
0039 //! The  second  method  should  be   redefined  to  put
0040 //! additional document  that   could  be  used by   the
0041 //! retrieval instead of the principal document, depending
0042 //! on the schema used during the retrieval.  For example,
0043 //! a    second     document   could   be     a   standard
0044 //! CDMShape_Document.    This  means   that a   client
0045 //! application will already be able to extract a CDMShape_Document
0046 //! of the file, if the Shape Schema remains unchanged.
0047 class PCDM_StorageDriver : public PCDM_Writer
0048 {
0049 
0050 public:
0051   //! raises NotImplemented.
0052   Standard_EXPORT virtual Handle(PCDM_Document) Make(const Handle(CDM_Document)& aDocument);
0053 
0054   //! By default, puts  in the Sequence the  document returns
0055   //! by the previous Make method.
0056   Standard_EXPORT virtual void Make(const Handle(CDM_Document)& aDocument,
0057                                     PCDM_SequenceOfDocument&    Documents);
0058 
0059   //! Warning! raises DriverError if an error occurs during inside the
0060   //! Make method.
0061   //! stores the content of the Document into a new file.
0062   //!
0063   //! by  default  Write will  use Make   method to build a persistent
0064   //! document and the Schema method to write the persistent document.
0065   Standard_EXPORT virtual void Write(
0066     const Handle(CDM_Document)&       aDocument,
0067     const TCollection_ExtendedString& aFileName,
0068     const Message_ProgressRange&      theRange = Message_ProgressRange()) Standard_OVERRIDE;
0069 
0070   //! Write <theDocument> to theOStream
0071   Standard_EXPORT virtual void Write(
0072     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   DEFINE_STANDARD_RTTIEXT(PCDM_StorageDriver, PCDM_Writer)
0089 
0090 protected:
0091 private:
0092   TCollection_ExtendedString myFormat;
0093   Standard_Boolean           myIsError;
0094   PCDM_StoreStatus           myStoreStatus;
0095 };
0096 
0097 #endif // _PCDM_StorageDriver_HeaderFile