Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:13:49

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   //! Retrieve the content of a file into a new document.
0028   Standard_EXPORT void Read(
0029     const TCollection_ExtendedString&     theFileName,
0030     const occ::handle<CDM_Document>&      theNewDocument,
0031     const occ::handle<CDM_Application>&   theApplication,
0032     const occ::handle<PCDM_ReaderFilter>& theFilter = occ::handle<PCDM_ReaderFilter>(),
0033     const Message_ProgressRange&          theRange  = Message_ProgressRange()) override;
0034 
0035   //! Override pure virtual method (raises exception Standard_NotImplemented)
0036   Standard_EXPORT void Read(
0037     Standard_IStream&                     theIStream,
0038     const occ::handle<Storage_Data>&      theStorageData,
0039     const occ::handle<CDM_Document>&      theDoc,
0040     const occ::handle<CDM_Application>&   theApplication,
0041     const occ::handle<PCDM_ReaderFilter>& theFilter = occ::handle<PCDM_ReaderFilter>(),
0042     const Message_ProgressRange&          theRange  = Message_ProgressRange()) override;
0043 
0044   DEFINE_STANDARD_RTTIEXT(StdLDrivers_DocumentRetrievalDriver, PCDM_RetrievalDriver)
0045 
0046 protected:
0047   //! Register types.
0048   Standard_EXPORT virtual void bindTypes(StdObjMgt_MapOfInstantiators& theMap);
0049 
0050 private:
0051   //! Read persistent document from a file.
0052   occ::handle<StdObjMgt_Persistent> read(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