Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2015 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 _StdLDrivers_DocumentRetrievalDriver_HeaderFile
0015 #define _StdLDrivers_DocumentRetrievalDriver_HeaderFile
0016 
0017 #include <PCDM_RetrievalDriver.hxx>
0018 #include <Storage_Error.hxx>
0019 
0020 class StdObjMgt_MapOfInstantiators;
0021 class StdObjMgt_Persistent;
0022 
0023 //! retrieval driver of a Part document
0024 class StdLDrivers_DocumentRetrievalDriver : public PCDM_RetrievalDriver
0025 {
0026 public:
0027 
0028   //! Retrieve the content of a file into a new document.
0029   Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName,
0030                                      const Handle(CDM_Document)&       theNewDocument,
0031                                      const Handle(CDM_Application)&    theApplication,
0032                                      const Handle(PCDM_ReaderFilter)&  theFilter = Handle(PCDM_ReaderFilter)(),
0033                                      const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0034 
0035   //! Override pure virtual method (raises exception Standard_NotImplemented) 
0036   Standard_EXPORT virtual void Read (Standard_IStream&              theIStream,
0037                                      const Handle(Storage_Data)&    theStorageData,
0038                                      const Handle(CDM_Document)&    theDoc,
0039                                      const Handle(CDM_Application)& theApplication,
0040                                      const Handle(PCDM_ReaderFilter)& theFilter = Handle(PCDM_ReaderFilter)(),
0041                                      const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0042 
0043   DEFINE_STANDARD_RTTIEXT (StdLDrivers_DocumentRetrievalDriver, PCDM_RetrievalDriver)
0044 
0045 protected:
0046   //! Register types.
0047   Standard_EXPORT virtual void bindTypes (StdObjMgt_MapOfInstantiators& theMap);
0048 
0049 private:
0050   //! Read persistent document from a file.
0051   Handle(StdObjMgt_Persistent) read (
0052     const TCollection_ExtendedString& theFileName,
0053     Storage_HeaderData&               theHeaderData);
0054 
0055   //! Update the reader status and raise an exception appropriate for the given storage error.
0056   Standard_EXPORT void raiseOnStorageError (Storage_Error theError);
0057 };
0058 
0059 #endif // _StdLDrivers_DocumentRetrievalDriver_HeaderFile