// File generated by CPPExt (Value)
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _Storage_BaseDriver_HeaderFile
#define _Storage_BaseDriver_HeaderFile

#ifndef _Storage_OpenMode_HeaderFile
#include <Storage_OpenMode.hxx>
#endif
#ifndef _TCollection_AsciiString_HeaderFile
#include <TCollection_AsciiString.hxx>
#endif
#ifndef _Storage_Error_HeaderFile
#include <Storage_Error.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Storage_Position_HeaderFile
#include <Storage_Position.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Character_HeaderFile
#include <Standard_Character.hxx>
#endif
#ifndef _Standard_ExtCharacter_HeaderFile
#include <Standard_ExtCharacter.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_ShortReal_HeaderFile
#include <Standard_ShortReal.hxx>
#endif
class Storage_StreamTypeMismatchError;
class Storage_StreamFormatError;
class Storage_StreamWriteError;
class Storage_StreamExtCharParityError;
class TCollection_AsciiString;
class TCollection_ExtendedString;
class TColStd_SequenceOfAsciiString;
class TColStd_SequenceOfExtendedString;


#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

//! Root class for drivers. A driver assigns a physical container <br>
//! to data to be stored or retrieved, for instance a file. <br>
//! The FSD package provides two derived concrete classes : <br>
//! -   FSD_File is a general driver which defines a <br>
//!   file as the container of data. <br>
class Storage_BaseDriver  {

public:

    void* operator new(size_t,void* anAddress) 
      {
        return anAddress;
      }
    void* operator new(size_t size) 
      { 
        return Standard::Allocate(size); 
      }
    void  operator delete(void *anAddress) 
      { 
        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
      }
 // Methods PUBLIC
 // 


Standard_EXPORT   void Delete() ;
Standard_EXPORT virtual ~Storage_BaseDriver(){Delete();}


Standard_EXPORT virtual  Storage_Error Open(const TCollection_AsciiString& aName,const Storage_OpenMode aMode)  = 0;

  TCollection_AsciiString Name() const;

  Storage_OpenMode OpenMode() const;

//! returns True if we are at end of the stream <br>
Standard_EXPORT virtual  Standard_Boolean IsEnd()  = 0;

//! return position in the file. Return -1 upon error. <br>
Standard_EXPORT virtual  Storage_Position Tell()  = 0;


Standard_EXPORT virtual  Storage_Error BeginWriteInfoSection()  = 0;


Standard_EXPORT virtual  void WriteInfo(const Standard_Integer nbObj,const TCollection_AsciiString& dbVersion,const TCollection_AsciiString& date,const TCollection_AsciiString& schemaName,const TCollection_AsciiString& schemaVersion,const TCollection_ExtendedString& appName,const TCollection_AsciiString& appVersion,const TCollection_ExtendedString& objectType,const TColStd_SequenceOfAsciiString& userInfo)  = 0;


Standard_EXPORT virtual  Storage_Error EndWriteInfoSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginReadInfoSection()  = 0;


Standard_EXPORT virtual  void ReadInfo(Standard_Integer& nbObj,TCollection_AsciiString& dbVersion,TCollection_AsciiString& date,TCollection_AsciiString& schemaName,TCollection_AsciiString& schemaVersion,TCollection_ExtendedString& appName,TCollection_AsciiString& appVersion,TCollection_ExtendedString& objectType,TColStd_SequenceOfAsciiString& userInfo)  = 0;


Standard_EXPORT virtual  Storage_Error EndReadInfoSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginWriteCommentSection()  = 0;


Standard_EXPORT virtual  void WriteComment(const TColStd_SequenceOfExtendedString& userComments)  = 0;


Standard_EXPORT virtual  Storage_Error EndWriteCommentSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginReadCommentSection()  = 0;


Standard_EXPORT virtual  void ReadComment(TColStd_SequenceOfExtendedString& userComments)  = 0;


Standard_EXPORT virtual  Storage_Error EndReadCommentSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginWriteTypeSection()  = 0;


Standard_EXPORT virtual  void SetTypeSectionSize(const Standard_Integer aSize)  = 0;


Standard_EXPORT virtual  void WriteTypeInformations(const Standard_Integer typeNum,const TCollection_AsciiString& typeName)  = 0;


Standard_EXPORT virtual  Storage_Error EndWriteTypeSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginReadTypeSection()  = 0;


Standard_EXPORT virtual  Standard_Integer TypeSectionSize()  = 0;


Standard_EXPORT virtual  void ReadTypeInformations(Standard_Integer& typeNum,TCollection_AsciiString& typeName)  = 0;


Standard_EXPORT virtual  Storage_Error EndReadTypeSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginWriteRootSection()  = 0;


Standard_EXPORT virtual  void SetRootSectionSize(const Standard_Integer aSize)  = 0;


Standard_EXPORT virtual  void WriteRoot(const TCollection_AsciiString& rootName,const Standard_Integer aRef,const TCollection_AsciiString& aType)  = 0;


Standard_EXPORT virtual  Storage_Error EndWriteRootSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginReadRootSection()  = 0;


Standard_EXPORT virtual  Standard_Integer RootSectionSize()  = 0;


Standard_EXPORT virtual  void ReadRoot(TCollection_AsciiString& rootName,Standard_Integer& aRef,TCollection_AsciiString& aType)  = 0;


Standard_EXPORT virtual  Storage_Error EndReadRootSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginWriteRefSection()  = 0;


Standard_EXPORT virtual  void SetRefSectionSize(const Standard_Integer aSize)  = 0;


Standard_EXPORT virtual  void WriteReferenceType(const Standard_Integer reference,const Standard_Integer typeNum)  = 0;


Standard_EXPORT virtual  Storage_Error EndWriteRefSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginReadRefSection()  = 0;


Standard_EXPORT virtual  Standard_Integer RefSectionSize()  = 0;


Standard_EXPORT virtual  void ReadReferenceType(Standard_Integer& reference,Standard_Integer& typeNum)  = 0;


Standard_EXPORT virtual  Storage_Error EndReadRefSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginWriteDataSection()  = 0;


Standard_EXPORT virtual  void WritePersistentObjectHeader(const Standard_Integer aRef,const Standard_Integer aType)  = 0;


Standard_EXPORT virtual  void BeginWritePersistentObjectData()  = 0;


Standard_EXPORT virtual  void BeginWriteObjectData()  = 0;


Standard_EXPORT virtual  void EndWriteObjectData()  = 0;


Standard_EXPORT virtual  void EndWritePersistentObjectData()  = 0;


Standard_EXPORT virtual  Storage_Error EndWriteDataSection()  = 0;


Standard_EXPORT virtual  Storage_Error BeginReadDataSection()  = 0;


Standard_EXPORT virtual  void ReadPersistentObjectHeader(Standard_Integer& aRef,Standard_Integer& aType)  = 0;


Standard_EXPORT virtual  void BeginReadPersistentObjectData()  = 0;


Standard_EXPORT virtual  void BeginReadObjectData()  = 0;


Standard_EXPORT virtual  void EndReadObjectData()  = 0;


Standard_EXPORT virtual  void EndReadPersistentObjectData()  = 0;


Standard_EXPORT virtual  Storage_Error EndReadDataSection()  = 0;


Standard_EXPORT virtual  void SkipObject()  = 0;


Standard_EXPORT virtual  Storage_BaseDriver& PutReference(const Standard_Integer aValue)  = 0;


Standard_EXPORT virtual  Storage_BaseDriver& PutCharacter(const Standard_Character aValue)  = 0;
  Storage_BaseDriver& operator <<(const Standard_Character aValue) 
{
  return PutCharacter(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& PutExtCharacter(const Standard_ExtCharacter aValue)  = 0;
  Storage_BaseDriver& operator <<(const Standard_ExtCharacter aValue) 
{
  return PutExtCharacter(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& PutInteger(const Standard_Integer aValue)  = 0;
  Storage_BaseDriver& operator <<(const Standard_Integer aValue) 
{
  return PutInteger(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& PutBoolean(const Standard_Boolean aValue)  = 0;
  Storage_BaseDriver& operator <<(const Standard_Boolean aValue) 
{
  return PutBoolean(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& PutReal(const Standard_Real aValue)  = 0;
  Storage_BaseDriver& operator <<(const Standard_Real aValue) 
{
  return PutReal(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& PutShortReal(const Standard_ShortReal aValue)  = 0;
  Storage_BaseDriver& operator <<(const Standard_ShortReal aValue) 
{
  return PutShortReal(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& GetReference(Standard_Integer& aValue)  = 0;


Standard_EXPORT virtual  Storage_BaseDriver& GetCharacter(Standard_Character& aValue)  = 0;
  Storage_BaseDriver& operator >>(Standard_Character& aValue) 
{
  return GetCharacter(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& GetExtCharacter(Standard_ExtCharacter& aValue)  = 0;
  Storage_BaseDriver& operator >>(Standard_ExtCharacter& aValue) 
{
  return GetExtCharacter(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& GetInteger(Standard_Integer& aValue)  = 0;
  Storage_BaseDriver& operator >>(Standard_Integer& aValue) 
{
  return GetInteger(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& GetBoolean(Standard_Boolean& aValue)  = 0;
  Storage_BaseDriver& operator >>(Standard_Boolean& aValue) 
{
  return GetBoolean(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& GetReal(Standard_Real& aValue)  = 0;
  Storage_BaseDriver& operator >>(Standard_Real& aValue) 
{
  return GetReal(aValue);
}



Standard_EXPORT virtual  Storage_BaseDriver& GetShortReal(Standard_ShortReal& aValue)  = 0;
  Storage_BaseDriver& operator >>(Standard_ShortReal& aValue) 
{
  return GetShortReal(aValue);
}



Standard_EXPORT virtual  Storage_Error Close()  = 0;





protected:

 // Methods PROTECTED
 // 


Standard_EXPORT Storage_BaseDriver();

  void SetName(const TCollection_AsciiString& aName) ;

  void SetOpenMode(const Storage_OpenMode aMode) ;


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
Storage_OpenMode myOpenMode;
TCollection_AsciiString myName;


};


#include <Storage_BaseDriver.lxx>



// other Inline functions and methods (like "C++: function call" methods)
//


#endif
