// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _BinLDrivers_DocumentRetrievalDriver_HeaderFile
#define _BinLDrivers_DocumentRetrievalDriver_HeaderFile

#include <Standard.hxx>
#include <Standard_DefineHandle.hxx>
#include <Handle_BinLDrivers_DocumentRetrievalDriver.hxx>

#include <BinObjMgt_Persistent.hxx>
#include <Handle_BinMDF_ADriverTable.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <Handle_CDM_MessageDriver.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <BinLDrivers_VectorOfDocumentSection.hxx>
#include <PCDM_RetrievalDriver.hxx>
#include <Handle_PCDM_Document.hxx>
#include <Handle_CDM_Document.hxx>
#include <Handle_CDM_Application.hxx>
#include <Standard_Integer.hxx>
#include <Standard_IStream.hxx>
#include <Storage_Position.hxx>
#include <Handle_Storage_HeaderData.hxx>
#include <Standard_Boolean.hxx>
class BinMDF_ADriverTable;
class CDM_MessageDriver;
class TCollection_ExtendedString;
class PCDM_Document;
class CDM_Document;
class CDM_Application;
class TDF_Label;
class TCollection_AsciiString;
class Storage_HeaderData;
class BinLDrivers_DocumentSection;



class BinLDrivers_DocumentRetrievalDriver : public PCDM_RetrievalDriver
{

public:

  
  //! Constructor
  Standard_EXPORT BinLDrivers_DocumentRetrievalDriver();
  
  //! pure virtual method definition
  Standard_EXPORT virtual   TCollection_ExtendedString SchemaName()  const;
  
  //! pure virtual method definition
  Standard_EXPORT virtual   void Make (const Handle(PCDM_Document)& PD, const Handle(CDM_Document)& TD) ;
  
  //! pure virtual method definition
  Standard_EXPORT virtual   Handle(CDM_Document) CreateDocument() ;
  
  //! retrieves the content of the file into a new Document.
  Standard_EXPORT virtual   void Read (const TCollection_ExtendedString& theFileName, const Handle(CDM_Document)& theNewDocument, const Handle(CDM_Application)& theApplication) ;
  
  Standard_EXPORT virtual   Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(CDM_MessageDriver)& theMsgDriver) ;




  DEFINE_STANDARD_RTTI(BinLDrivers_DocumentRetrievalDriver)

protected:

  
  //! Read the tree from the stream <theIS> to <theLabel>
  Standard_EXPORT virtual   Standard_Integer ReadSubTree (Standard_IStream& theIS, const TDF_Label& theData) ;
  
  //! Read the  info  section  of  theFile into theData,
  //! return a file  position  corresponding to the info
  //! section end
  Standard_EXPORT   Storage_Position ReadInfoSection (const TCollection_AsciiString& theFile, Handle(Storage_HeaderData)& theData) ;
  
  //! define the procedure of reading a section to file.
  Standard_EXPORT virtual   void ReadSection (BinLDrivers_DocumentSection& theSection, const Handle(CDM_Document)& theDoc, Standard_IStream& theIS) ;
  
  Standard_EXPORT virtual   void ReadShapeSection (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS, const Standard_Boolean isMess = Standard_False) ;
  
  Standard_EXPORT virtual   void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS) ;
  
  Standard_EXPORT virtual   void PropagateDocumentVersion (const Standard_Integer theVersion) ;
  
  //! Check a file version(in which file was written) with a current version.
  //! Redefining this method is a chance for application to read files
  //! written by newer applications.
  //! The default implementation: if the version of the file is greater than the
  //! current or lesser than 2, then return false, else true
  Standard_EXPORT virtual   Standard_Boolean CheckDocumentVersion (const Standard_Integer theFileVersion, const Standard_Integer theCurVersion) ;
  
  //! write  theMessage  to  the  MessageDriver  of  the
  //! Application
  Standard_EXPORT   void WriteMessage (const TCollection_ExtendedString& theMessage) ;

  Handle(BinMDF_ADriverTable) myDrivers;
  BinObjMgt_RRelocationTable myRelocTable;


private: 


  BinObjMgt_Persistent myPAtt;
  Handle(CDM_MessageDriver) myMsgDriver;
  TColStd_MapOfInteger myMapUnsupported;
  BinLDrivers_VectorOfDocumentSection mySections;


};







#endif // _BinLDrivers_DocumentRetrievalDriver_HeaderFile
