Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:16:48

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_Document.hxx>
0027 #include <NCollection_Sequence.hxx>
0028 class PCDM_Document;
0029 class CDM_Document;
0030 
0031 //! persistent implementation of storage.
0032 //!
0033 //! The application must redefine one the two Make()
0034 //! methods. The first one, if the application wants to
0035 //! put only one document in the storage file.
0036 //!
0037 //! The second method should be redefined to put
0038 //! additional document that could be used by the
0039 //! retrieval instead of the principal document, depending
0040 //! on the schema used during the retrieval.
0041 //! For example, a second document could be a standard
0042 //! CDMShape_Document. This means that a client
0043 //! application will already be able to extract a CDMShape_Document
0044 //! of the file, if the Shape Schema remains unchanged.
0045 class PCDM_StorageDriver : public PCDM_Writer
0046 {
0047 
0048 public:
0049   //! raises NotImplemented.
0050   Standard_EXPORT virtual occ::handle<PCDM_Document> Make(
0051     const occ::handle<CDM_Document>& aDocument);
0052 
0053   //! By default, puts in the Sequence the document returns
0054   //! by the previous Make method.
0055   Standard_EXPORT virtual void Make(const occ::handle<CDM_Document>&                  aDocument,
0056                                     NCollection_Sequence<occ::handle<PCDM_Document>>& Documents);
0057 
0058   //! Warning! raises DriverError if an error occurs during inside the
0059   //! Make method.
0060   //! stores the content of the Document into a new file.
0061   //!
0062   //! by default Write will use Make method to build a persistent
0063   //! document and the Schema method to write the persistent document.
0064   Standard_EXPORT void Write(
0065     const occ::handle<CDM_Document>&  aDocument,
0066     const TCollection_ExtendedString& aFileName,
0067     const Message_ProgressRange&      theRange = Message_ProgressRange()) override;
0068 
0069   //! Write <theDocument> to theOStream
0070   Standard_EXPORT void Write(
0071     const occ::handle<CDM_Document>& theDocument,
0072     Standard_OStream&                theOStream,
0073     const Message_ProgressRange&     theRange = Message_ProgressRange()) override;
0074 
0075   Standard_EXPORT void SetFormat(const TCollection_ExtendedString& aformat);
0076 
0077   Standard_EXPORT TCollection_ExtendedString GetFormat() const;
0078 
0079   Standard_EXPORT bool IsError() const;
0080 
0081   Standard_EXPORT void SetIsError(const bool theIsError);
0082 
0083   Standard_EXPORT PCDM_StoreStatus GetStoreStatus() const;
0084 
0085   Standard_EXPORT void SetStoreStatus(const PCDM_StoreStatus theStoreStatus);
0086 
0087   DEFINE_STANDARD_RTTIEXT(PCDM_StorageDriver, PCDM_Writer)
0088 
0089 private:
0090   TCollection_ExtendedString myFormat;
0091   bool                       myIsError;
0092   PCDM_StoreStatus           myStoreStatus;
0093 };
0094 
0095 #endif // _PCDM_StorageDriver_HeaderFile