mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
FSD_FStream.hxx
|
||||
FILES
|
||||
FSD_BinaryFile.cxx
|
||||
FSD_BinaryFile.hxx
|
||||
FSD_BStream.hxx
|
||||
FSD_CmpFile.cxx
|
||||
FSD_CmpFile.hxx
|
||||
FSD_File.cxx
|
||||
FSD_File.hxx
|
||||
FSD_FileHeader.hxx
|
||||
FSD_FStream.hxx
|
||||
|
@@ -1,32 +0,0 @@
|
||||
-- Created on: 1996-11-29
|
||||
-- Created by: Christophe LEYNADIER
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package FSD
|
||||
uses Storage,
|
||||
TColStd,
|
||||
TCollection,
|
||||
OSD
|
||||
is
|
||||
|
||||
class File;
|
||||
class BinaryFile;
|
||||
class CmpFile;
|
||||
|
||||
imported FStream;
|
||||
imported BStream;
|
||||
imported FileHeader;
|
||||
|
||||
end;
|
@@ -1,323 +0,0 @@
|
||||
-- Created on: 1996-11-29
|
||||
-- Created by: Christophe LEYNADIER
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class BinaryFile from FSD
|
||||
|
||||
inherits BaseDriver from Storage
|
||||
|
||||
uses Position from Storage,
|
||||
Error from Storage,
|
||||
OpenMode from Storage,
|
||||
AsciiString from TCollection,
|
||||
SequenceOfAsciiString from TColStd,
|
||||
SequenceOfExtendedString from TColStd,
|
||||
ExtendedString from TCollection,
|
||||
FileHeader from FSD,
|
||||
BStream from FSD
|
||||
|
||||
raises StreamTypeMismatchError from Storage,
|
||||
StreamFormatError from Storage,
|
||||
StreamWriteError from Storage,
|
||||
StreamExtCharParityError from Storage
|
||||
|
||||
is
|
||||
Create returns BinaryFile from FSD;
|
||||
|
||||
Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage;
|
||||
|
||||
IsEnd(me : in out) returns Boolean from Standard;
|
||||
|
||||
Tell( me : in out ) returns Position from Storage;
|
||||
---Purpose: return position in the file. Return -1 upon error.
|
||||
|
||||
IsGoodFileType(myclass; aName : AsciiString from TCollection)
|
||||
returns Error from Storage;
|
||||
|
||||
-- INFO SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
WriteInfo(me : in out; nbObj : Integer from Standard;
|
||||
dbVersion : AsciiString from TCollection;
|
||||
date : AsciiString from TCollection;
|
||||
schemaName : AsciiString from TCollection;
|
||||
schemaVersion : AsciiString from TCollection;
|
||||
appName : ExtendedString from TCollection;
|
||||
appVersion : AsciiString from TCollection;
|
||||
objectType : ExtendedString from TCollection;
|
||||
userInfo : SequenceOfAsciiString from TColStd)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadInfo(me : in out; nbObj : in out Integer from Standard;
|
||||
dbVersion : in out AsciiString from TCollection;
|
||||
date : in out AsciiString from TCollection;
|
||||
schemaName : in out AsciiString from TCollection;
|
||||
schemaVersion : in out AsciiString from TCollection;
|
||||
appName : in out ExtendedString from TCollection;
|
||||
appVersion : in out AsciiString from TCollection;
|
||||
objectType : in out ExtendedString from TCollection;
|
||||
userInfo : in out SequenceOfAsciiString from TColStd)
|
||||
raises StreamTypeMismatchError,StreamExtCharParityError;
|
||||
|
||||
EndReadInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- COMMENTS SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
|
||||
raises StreamTypeMismatchError,StreamExtCharParityError;
|
||||
|
||||
EndReadCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
|
||||
-- TYPE SECTION
|
||||
--
|
||||
BeginWriteTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetTypeSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
BeginReadTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
TypeSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- ROOT SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetRootSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
RootSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- REF SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetRefSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
RefSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- DATA SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
BeginWritePersistentObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
BeginWriteObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWritePersistentObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
|
||||
raises StreamTypeMismatchError,StreamFormatError;
|
||||
|
||||
BeginReadPersistentObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
BeginReadObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadPersistentObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
--
|
||||
SkipObject(me : in out);
|
||||
--
|
||||
|
||||
PutReference(me : in out; aValue : Integer from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: return &
|
||||
|
||||
PutCharacter(me : in out; aValue : Character from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutInteger(me : in out; aValue : Integer from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutBoolean(me : in out; aValue : Boolean from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutReal(me : in out; aValue : Real from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
GetReference(me : in out; aValue : in out Integer from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: return &
|
||||
|
||||
GetCharacter(me : in out; aValue : in out Character from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetInteger(me : in out; aValue : in out Integer from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetReal(me : in out; aValue :in out Real from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
Close(me : in out) returns Error from Storage;
|
||||
|
||||
Destroy(me : in out);
|
||||
---C++: alias ~
|
||||
|
||||
WriteHeader(me : in out) is private;
|
||||
ReadHeader(me : in out) is private;
|
||||
|
||||
MagicNumber(myclass)
|
||||
returns CString from Standard is private;
|
||||
---C++: return const
|
||||
|
||||
ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected;
|
||||
---Purpose: read <rsize> character from the current position.
|
||||
|
||||
ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read string from the current position.
|
||||
|
||||
WriteString(me : in out; buffer : AsciiString from TCollection) is protected;
|
||||
---Purpose: write string at the current position.
|
||||
|
||||
ReadExtendedString(me : in out; buffer : in out ExtendedString from TCollection) is protected;
|
||||
---Purpose: read string from the current position.
|
||||
|
||||
WriteExtendedString(me : in out; buffer : ExtendedString from TCollection) is protected;
|
||||
---Purpose: write string at the current position.
|
||||
|
||||
fields
|
||||
|
||||
myStream : BStream from FSD;
|
||||
myHeader : FileHeader from FSD;
|
||||
end;
|
@@ -12,9 +12,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <FSD_BinaryFile.ixx>
|
||||
|
||||
#include <FSD_BinaryFile.hxx>
|
||||
#include <OSD.hxx>
|
||||
#include <OSD_OpenFile.hxx>
|
||||
#include <Storage_BaseDriver.hxx>
|
||||
#include <Storage_StreamExtCharParityError.hxx>
|
||||
#include <Storage_StreamFormatError.hxx>
|
||||
#include <Storage_StreamTypeMismatchError.hxx>
|
||||
#include <Storage_StreamWriteError.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
const Standard_CString MAGICNUMBER = "BINFILE";
|
||||
|
||||
|
300
src/FSD/FSD_BinaryFile.hxx
Normal file
300
src/FSD/FSD_BinaryFile.hxx
Normal file
@@ -0,0 +1,300 @@
|
||||
// Created on: 1996-11-29
|
||||
// Created by: Christophe LEYNADIER
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _FSD_BinaryFile_HeaderFile
|
||||
#define _FSD_BinaryFile_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <FSD_BStream.hxx>
|
||||
#include <FSD_FileHeader.hxx>
|
||||
#include <Storage_BaseDriver.hxx>
|
||||
#include <Storage_Error.hxx>
|
||||
#include <Storage_OpenMode.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Storage_Position.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||
#include <Standard_Character.hxx>
|
||||
#include <Standard_ExtCharacter.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Size.hxx>
|
||||
class Storage_StreamTypeMismatchError;
|
||||
class Storage_StreamFormatError;
|
||||
class Storage_StreamWriteError;
|
||||
class Storage_StreamExtCharParityError;
|
||||
class TCollection_AsciiString;
|
||||
class TCollection_ExtendedString;
|
||||
class Storage_BaseDriver;
|
||||
|
||||
|
||||
|
||||
class FSD_BinaryFile : public Storage_BaseDriver
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT FSD_BinaryFile();
|
||||
|
||||
Standard_EXPORT Storage_Error Open (const TCollection_AsciiString& aName, const Storage_OpenMode aMode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsEnd();
|
||||
|
||||
//! return position in the file. Return -1 upon error.
|
||||
Standard_EXPORT Storage_Position Tell();
|
||||
|
||||
Standard_EXPORT static Storage_Error IsGoodFileType (const TCollection_AsciiString& aName);
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteInfoSection();
|
||||
|
||||
Standard_EXPORT 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);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteInfoSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadInfoSection();
|
||||
|
||||
Standard_EXPORT 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);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadInfoSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteCommentSection();
|
||||
|
||||
Standard_EXPORT void WriteComment (const TColStd_SequenceOfExtendedString& userComments);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteCommentSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadCommentSection();
|
||||
|
||||
Standard_EXPORT void ReadComment (TColStd_SequenceOfExtendedString& userComments);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadCommentSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteTypeSection();
|
||||
|
||||
Standard_EXPORT void SetTypeSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteTypeInformations (const Standard_Integer typeNum, const TCollection_AsciiString& typeName);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteTypeSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadTypeSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer TypeSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadTypeInformations (Standard_Integer& typeNum, TCollection_AsciiString& typeName);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadTypeSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteRootSection();
|
||||
|
||||
Standard_EXPORT void SetRootSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteRoot (const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& aType);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteRootSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadRootSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer RootSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadRoot (TCollection_AsciiString& rootName, Standard_Integer& aRef, TCollection_AsciiString& aType);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadRootSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteRefSection();
|
||||
|
||||
Standard_EXPORT void SetRefSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteReferenceType (const Standard_Integer reference, const Standard_Integer typeNum);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteRefSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadRefSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer RefSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadReferenceType (Standard_Integer& reference, Standard_Integer& typeNum);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadRefSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteDataSection();
|
||||
|
||||
Standard_EXPORT void WritePersistentObjectHeader (const Standard_Integer aRef, const Standard_Integer aType);
|
||||
|
||||
Standard_EXPORT void BeginWritePersistentObjectData();
|
||||
|
||||
Standard_EXPORT void BeginWriteObjectData();
|
||||
|
||||
Standard_EXPORT void EndWriteObjectData();
|
||||
|
||||
Standard_EXPORT void EndWritePersistentObjectData();
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteDataSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadDataSection();
|
||||
|
||||
Standard_EXPORT void ReadPersistentObjectHeader (Standard_Integer& aRef, Standard_Integer& aType);
|
||||
|
||||
Standard_EXPORT void BeginReadPersistentObjectData();
|
||||
|
||||
Standard_EXPORT void BeginReadObjectData();
|
||||
|
||||
Standard_EXPORT void EndReadObjectData();
|
||||
|
||||
Standard_EXPORT void EndReadPersistentObjectData();
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadDataSection();
|
||||
|
||||
Standard_EXPORT void SkipObject();
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutReference (const Standard_Integer aValue);
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutCharacter (const Standard_Character aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Character aValue)
|
||||
{
|
||||
return PutCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutExtCharacter (const Standard_ExtCharacter aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_ExtCharacter aValue)
|
||||
{
|
||||
return PutExtCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutInteger (const Standard_Integer aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Integer aValue)
|
||||
{
|
||||
return PutInteger(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutBoolean (const Standard_Boolean aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Boolean aValue)
|
||||
{
|
||||
return PutBoolean(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutReal (const Standard_Real aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Real aValue)
|
||||
{
|
||||
return PutReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutShortReal (const Standard_ShortReal aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_ShortReal aValue)
|
||||
{
|
||||
return PutShortReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetReference (Standard_Integer& aValue);
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetCharacter (Standard_Character& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Character& aValue)
|
||||
{
|
||||
return GetCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetExtCharacter (Standard_ExtCharacter& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_ExtCharacter& aValue)
|
||||
{
|
||||
return GetExtCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetInteger (Standard_Integer& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Integer& aValue)
|
||||
{
|
||||
return GetInteger(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetBoolean (Standard_Boolean& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Boolean& aValue)
|
||||
{
|
||||
return GetBoolean(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetReal (Standard_Real& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Real& aValue)
|
||||
{
|
||||
return GetReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetShortReal (Standard_ShortReal& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_ShortReal& aValue)
|
||||
{
|
||||
return GetShortReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_Error Close();
|
||||
|
||||
Standard_EXPORT void Destroy();
|
||||
~FSD_BinaryFile()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! read <rsize> character from the current position.
|
||||
Standard_EXPORT void ReadChar (TCollection_AsciiString& buffer, const Standard_Size rsize);
|
||||
|
||||
//! read string from the current position.
|
||||
Standard_EXPORT void ReadString (TCollection_AsciiString& buffer);
|
||||
|
||||
//! write string at the current position.
|
||||
Standard_EXPORT void WriteString (const TCollection_AsciiString& buffer);
|
||||
|
||||
//! read string from the current position.
|
||||
Standard_EXPORT void ReadExtendedString (TCollection_ExtendedString& buffer);
|
||||
|
||||
//! write string at the current position.
|
||||
Standard_EXPORT void WriteExtendedString (const TCollection_ExtendedString& buffer);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void WriteHeader();
|
||||
|
||||
Standard_EXPORT void ReadHeader();
|
||||
|
||||
Standard_EXPORT static const Standard_CString MagicNumber();
|
||||
|
||||
|
||||
FSD_BStream myStream;
|
||||
FSD_FileHeader myHeader;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _FSD_BinaryFile_HeaderFile
|
@@ -1,329 +0,0 @@
|
||||
-- Created on: 1996-11-29
|
||||
-- Created by: Christophe LEYNADIER
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CmpFile from FSD
|
||||
|
||||
inherits BaseDriver from Storage
|
||||
|
||||
uses Position from Storage,
|
||||
Error from Storage,
|
||||
OpenMode from Storage,
|
||||
AsciiString from TCollection,
|
||||
SequenceOfAsciiString from TColStd,
|
||||
SequenceOfExtendedString from TColStd,
|
||||
ExtendedString from TCollection,
|
||||
FStream from FSD
|
||||
|
||||
raises StreamTypeMismatchError from Storage,
|
||||
StreamFormatError from Storage,
|
||||
StreamWriteError from Storage,
|
||||
StreamExtCharParityError from Storage
|
||||
|
||||
is
|
||||
Create returns CmpFile from FSD;
|
||||
|
||||
Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage;
|
||||
|
||||
IsEnd(me : in out) returns Boolean from Standard;
|
||||
|
||||
Tell( me : in out ) returns Position from Storage;
|
||||
---Purpose: return position in the file. Return -1 upon error.
|
||||
|
||||
IsGoodFileType(myclass; aName : AsciiString from TCollection)
|
||||
returns Error from Storage;
|
||||
|
||||
-- INFO SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
WriteInfo(me : in out; nbObj : Integer from Standard;
|
||||
dbVersion : AsciiString from TCollection;
|
||||
date : AsciiString from TCollection;
|
||||
schemaName : AsciiString from TCollection;
|
||||
schemaVersion : AsciiString from TCollection;
|
||||
appName : ExtendedString from TCollection;
|
||||
appVersion : AsciiString from TCollection;
|
||||
objectType : ExtendedString from TCollection;
|
||||
userInfo : SequenceOfAsciiString from TColStd)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadInfo(me : in out; nbObj : in out Integer from Standard;
|
||||
dbVersion : in out AsciiString from TCollection;
|
||||
date : in out AsciiString from TCollection;
|
||||
schemaName : in out AsciiString from TCollection;
|
||||
schemaVersion : in out AsciiString from TCollection;
|
||||
appName : in out ExtendedString from TCollection;
|
||||
appVersion : in out AsciiString from TCollection;
|
||||
objectType : in out ExtendedString from TCollection;
|
||||
userInfo : in out SequenceOfAsciiString from TColStd)
|
||||
raises StreamTypeMismatchError,StreamExtCharParityError;
|
||||
|
||||
EndReadInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- COMMENTS SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
|
||||
raises StreamTypeMismatchError,StreamExtCharParityError;
|
||||
|
||||
EndReadCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
|
||||
-- TYPE SECTION
|
||||
--
|
||||
BeginWriteTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetTypeSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
BeginReadTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
TypeSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- ROOT SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetRootSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
RootSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- REF SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetRefSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
RefSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- DATA SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
BeginWritePersistentObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
BeginWriteObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWritePersistentObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
|
||||
raises StreamTypeMismatchError,StreamFormatError;
|
||||
|
||||
BeginReadPersistentObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
BeginReadObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadPersistentObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
--
|
||||
SkipObject(me : in out);
|
||||
--
|
||||
|
||||
PutReference(me : in out; aValue : Integer from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: return &
|
||||
|
||||
PutCharacter(me : in out; aValue : Character from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutInteger(me : in out; aValue : Integer from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutBoolean(me : in out; aValue : Boolean from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutReal(me : in out; aValue : Real from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
GetReference(me : in out; aValue : in out Integer from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: return &
|
||||
|
||||
GetCharacter(me : in out; aValue : in out Character from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetInteger(me : in out; aValue : in out Integer from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetReal(me : in out; aValue :in out Real from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
Close(me : in out) returns Error from Storage;
|
||||
|
||||
Destroy(me : in out);
|
||||
---C++: alias ~
|
||||
|
||||
ReadLine(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read from the current position to the end of line.
|
||||
|
||||
ReadWord(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read from the current position to the next white space or end of line.
|
||||
|
||||
ReadExtendedLine(me : in out; buffer : in out ExtendedString from TCollection)
|
||||
raises StreamExtCharParityError
|
||||
is protected;
|
||||
---Purpose: read extended chars (unicode) from the current position to the end of line.
|
||||
|
||||
WriteExtendedLine(me : in out; buffer : ExtendedString from TCollection) is protected;
|
||||
---Purpose: write from the current position to the end of line.
|
||||
|
||||
ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected;
|
||||
---Purpose: read <rsize> character from the current position.
|
||||
|
||||
ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read from the first none space character position to the end of line.
|
||||
|
||||
FlushEndOfLine(me : in out) is protected;
|
||||
|
||||
FindTag(me : in out; aTag : CString from Standard) returns Error from Storage is protected;
|
||||
|
||||
MagicNumber(myclass)
|
||||
returns CString from Standard is private;
|
||||
---C++: return const
|
||||
|
||||
RaiseError(me: in out ; theFailure: Type from Standard) is private;
|
||||
|
||||
fields
|
||||
|
||||
myStream : FStream from FSD;
|
||||
end;
|
@@ -12,12 +12,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <FSD_CmpFile.ixx>
|
||||
#include <OSD.hxx>
|
||||
|
||||
#include <Storage_StreamModeError.hxx>
|
||||
#include <Storage_StreamUnknownTypeError.hxx>
|
||||
#include <FSD_CmpFile.hxx>
|
||||
#include <OSD.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <Storage_BaseDriver.hxx>
|
||||
#include <Storage_StreamExtCharParityError.hxx>
|
||||
#include <Storage_StreamFormatError.hxx>
|
||||
#include <Storage_StreamModeError.hxx>
|
||||
#include <Storage_StreamTypeMismatchError.hxx>
|
||||
#include <Storage_StreamUnknownTypeError.hxx>
|
||||
#include <Storage_StreamWriteError.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
const Standard_CString MAGICNUMBER = "CMPFILE";
|
||||
|
||||
|
304
src/FSD/FSD_CmpFile.hxx
Normal file
304
src/FSD/FSD_CmpFile.hxx
Normal file
@@ -0,0 +1,304 @@
|
||||
// Created on: 1996-11-29
|
||||
// Created by: Christophe LEYNADIER
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _FSD_CmpFile_HeaderFile
|
||||
#define _FSD_CmpFile_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <FSD_FStream.hxx>
|
||||
#include <Storage_BaseDriver.hxx>
|
||||
#include <Storage_Error.hxx>
|
||||
#include <Storage_OpenMode.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Storage_Position.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||
#include <Standard_Character.hxx>
|
||||
#include <Standard_ExtCharacter.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_Size.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
class Storage_StreamTypeMismatchError;
|
||||
class Storage_StreamFormatError;
|
||||
class Storage_StreamWriteError;
|
||||
class Storage_StreamExtCharParityError;
|
||||
class TCollection_AsciiString;
|
||||
class TCollection_ExtendedString;
|
||||
class Storage_BaseDriver;
|
||||
|
||||
|
||||
|
||||
class FSD_CmpFile : public Storage_BaseDriver
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT FSD_CmpFile();
|
||||
|
||||
Standard_EXPORT Storage_Error Open (const TCollection_AsciiString& aName, const Storage_OpenMode aMode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsEnd();
|
||||
|
||||
//! return position in the file. Return -1 upon error.
|
||||
Standard_EXPORT Storage_Position Tell();
|
||||
|
||||
Standard_EXPORT static Storage_Error IsGoodFileType (const TCollection_AsciiString& aName);
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteInfoSection();
|
||||
|
||||
Standard_EXPORT 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);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteInfoSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadInfoSection();
|
||||
|
||||
Standard_EXPORT 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);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadInfoSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteCommentSection();
|
||||
|
||||
Standard_EXPORT void WriteComment (const TColStd_SequenceOfExtendedString& userComments);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteCommentSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadCommentSection();
|
||||
|
||||
Standard_EXPORT void ReadComment (TColStd_SequenceOfExtendedString& userComments);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadCommentSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteTypeSection();
|
||||
|
||||
Standard_EXPORT void SetTypeSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteTypeInformations (const Standard_Integer typeNum, const TCollection_AsciiString& typeName);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteTypeSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadTypeSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer TypeSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadTypeInformations (Standard_Integer& typeNum, TCollection_AsciiString& typeName);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadTypeSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteRootSection();
|
||||
|
||||
Standard_EXPORT void SetRootSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteRoot (const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& aType);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteRootSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadRootSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer RootSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadRoot (TCollection_AsciiString& rootName, Standard_Integer& aRef, TCollection_AsciiString& aType);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadRootSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteRefSection();
|
||||
|
||||
Standard_EXPORT void SetRefSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteReferenceType (const Standard_Integer reference, const Standard_Integer typeNum);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteRefSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadRefSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer RefSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadReferenceType (Standard_Integer& reference, Standard_Integer& typeNum);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadRefSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteDataSection();
|
||||
|
||||
Standard_EXPORT void WritePersistentObjectHeader (const Standard_Integer aRef, const Standard_Integer aType);
|
||||
|
||||
Standard_EXPORT void BeginWritePersistentObjectData();
|
||||
|
||||
Standard_EXPORT void BeginWriteObjectData();
|
||||
|
||||
Standard_EXPORT void EndWriteObjectData();
|
||||
|
||||
Standard_EXPORT void EndWritePersistentObjectData();
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteDataSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadDataSection();
|
||||
|
||||
Standard_EXPORT void ReadPersistentObjectHeader (Standard_Integer& aRef, Standard_Integer& aType);
|
||||
|
||||
Standard_EXPORT void BeginReadPersistentObjectData();
|
||||
|
||||
Standard_EXPORT void BeginReadObjectData();
|
||||
|
||||
Standard_EXPORT void EndReadObjectData();
|
||||
|
||||
Standard_EXPORT void EndReadPersistentObjectData();
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadDataSection();
|
||||
|
||||
Standard_EXPORT void SkipObject();
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutReference (const Standard_Integer aValue);
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutCharacter (const Standard_Character aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Character aValue)
|
||||
{
|
||||
return PutCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutExtCharacter (const Standard_ExtCharacter aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_ExtCharacter aValue)
|
||||
{
|
||||
return PutExtCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutInteger (const Standard_Integer aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Integer aValue)
|
||||
{
|
||||
return PutInteger(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutBoolean (const Standard_Boolean aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Boolean aValue)
|
||||
{
|
||||
return PutBoolean(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutReal (const Standard_Real aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Real aValue)
|
||||
{
|
||||
return PutReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutShortReal (const Standard_ShortReal aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_ShortReal aValue)
|
||||
{
|
||||
return PutShortReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetReference (Standard_Integer& aValue);
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetCharacter (Standard_Character& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Character& aValue)
|
||||
{
|
||||
return GetCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetExtCharacter (Standard_ExtCharacter& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_ExtCharacter& aValue)
|
||||
{
|
||||
return GetExtCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetInteger (Standard_Integer& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Integer& aValue)
|
||||
{
|
||||
return GetInteger(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetBoolean (Standard_Boolean& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Boolean& aValue)
|
||||
{
|
||||
return GetBoolean(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetReal (Standard_Real& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Real& aValue)
|
||||
{
|
||||
return GetReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetShortReal (Standard_ShortReal& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_ShortReal& aValue)
|
||||
{
|
||||
return GetShortReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_Error Close();
|
||||
|
||||
Standard_EXPORT void Destroy();
|
||||
~FSD_CmpFile()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! read from the current position to the end of line.
|
||||
Standard_EXPORT void ReadLine (TCollection_AsciiString& buffer);
|
||||
|
||||
//! read from the current position to the next white space or end of line.
|
||||
Standard_EXPORT void ReadWord (TCollection_AsciiString& buffer);
|
||||
|
||||
//! read extended chars (unicode) from the current position to the end of line.
|
||||
Standard_EXPORT void ReadExtendedLine (TCollection_ExtendedString& buffer);
|
||||
|
||||
//! write from the current position to the end of line.
|
||||
Standard_EXPORT void WriteExtendedLine (const TCollection_ExtendedString& buffer);
|
||||
|
||||
//! read <rsize> character from the current position.
|
||||
Standard_EXPORT void ReadChar (TCollection_AsciiString& buffer, const Standard_Size rsize);
|
||||
|
||||
//! read from the first none space character position to the end of line.
|
||||
Standard_EXPORT void ReadString (TCollection_AsciiString& buffer);
|
||||
|
||||
Standard_EXPORT void FlushEndOfLine();
|
||||
|
||||
Standard_EXPORT Storage_Error FindTag (const Standard_CString aTag);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT static const Standard_CString MagicNumber();
|
||||
|
||||
Standard_EXPORT void RaiseError (const Handle(Standard_Type)& theFailure);
|
||||
|
||||
|
||||
FSD_FStream myStream;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _FSD_CmpFile_HeaderFile
|
@@ -1,343 +0,0 @@
|
||||
-- Created on: 1996-11-29
|
||||
-- Created by: Christophe LEYNADIER
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class File from FSD
|
||||
|
||||
inherits BaseDriver from Storage
|
||||
---Purpose:
|
||||
-- A general driver which defines as a file, the
|
||||
-- physical container for data to be stored or retrieved.
|
||||
uses Position from Storage,
|
||||
Error from Storage,
|
||||
OpenMode from Storage,
|
||||
AsciiString from TCollection,
|
||||
SequenceOfAsciiString from TColStd,
|
||||
SequenceOfExtendedString from TColStd,
|
||||
ExtendedString from TCollection,
|
||||
FStream from FSD
|
||||
|
||||
raises StreamTypeMismatchError from Storage,
|
||||
StreamFormatError from Storage,
|
||||
StreamWriteError from Storage,
|
||||
StreamExtCharParityError from Storage
|
||||
|
||||
is
|
||||
Create returns File from FSD;
|
||||
---Purpose:
|
||||
-- Constructs a driver defining as a file, the physical
|
||||
-- container for data to be stored or retrieved.
|
||||
-- Use the function Open to give the name of the driven file.
|
||||
Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage;
|
||||
---Purpose:
|
||||
-- Assigns as aName the name of the file to be
|
||||
-- driven by this driver. aMode precises if the file is
|
||||
-- opened in read or write mode.
|
||||
-- The function returns Storage_VSOk if the file
|
||||
-- is opened correctly, or any other value of the
|
||||
-- Storage_Error enumeration which specifies the problem encountered.
|
||||
IsEnd(me : in out) returns Boolean from Standard;
|
||||
|
||||
Tell( me : in out ) returns Position from Storage;
|
||||
---Purpose: return position in the file. Return -1 upon error.
|
||||
|
||||
IsGoodFileType(myclass; aName : AsciiString from TCollection)
|
||||
returns Error from Storage;
|
||||
|
||||
-- INFO SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
WriteInfo(me : in out; nbObj : Integer from Standard;
|
||||
dbVersion : AsciiString from TCollection;
|
||||
date : AsciiString from TCollection;
|
||||
schemaName : AsciiString from TCollection;
|
||||
schemaVersion : AsciiString from TCollection;
|
||||
appName : ExtendedString from TCollection;
|
||||
appVersion : AsciiString from TCollection;
|
||||
objectType : ExtendedString from TCollection;
|
||||
userInfo : SequenceOfAsciiString from TColStd)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadInfo(me : in out; nbObj : in out Integer from Standard;
|
||||
dbVersion : in out AsciiString from TCollection;
|
||||
date : in out AsciiString from TCollection;
|
||||
schemaName : in out AsciiString from TCollection;
|
||||
schemaVersion : in out AsciiString from TCollection;
|
||||
appName : in out ExtendedString from TCollection;
|
||||
appVersion : in out AsciiString from TCollection;
|
||||
objectType : in out ExtendedString from TCollection;
|
||||
userInfo : in out SequenceOfAsciiString from TColStd)
|
||||
raises StreamTypeMismatchError,StreamExtCharParityError;
|
||||
|
||||
EndReadInfoSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- COMMENTS SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
|
||||
raises StreamTypeMismatchError,StreamExtCharParityError;
|
||||
|
||||
EndReadCommentSection(me : in out) returns Error from Storage;
|
||||
|
||||
|
||||
-- TYPE SECTION
|
||||
--
|
||||
BeginWriteTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetTypeSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
BeginReadTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
TypeSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadTypeSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- ROOT SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetRootSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
RootSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadRootSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- REF SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
SetRefSectionSize(me : in out; aSize : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
RefSectionSize(me : in out) returns Integer from Standard
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
|
||||
raises StreamTypeMismatchError;
|
||||
|
||||
EndReadRefSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- DATA SECTION
|
||||
-- write
|
||||
--
|
||||
BeginWriteDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
|
||||
raises StreamWriteError;
|
||||
|
||||
BeginWritePersistentObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
BeginWriteObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWritePersistentObjectData(me : in out)
|
||||
raises StreamWriteError;
|
||||
|
||||
EndWriteDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
-- read
|
||||
--
|
||||
BeginReadDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
|
||||
raises StreamTypeMismatchError,StreamFormatError;
|
||||
|
||||
BeginReadPersistentObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
BeginReadObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadPersistentObjectData(me : in out)
|
||||
raises StreamFormatError;
|
||||
|
||||
EndReadDataSection(me : in out) returns Error from Storage;
|
||||
|
||||
--
|
||||
SkipObject(me : in out);
|
||||
--
|
||||
|
||||
PutReference(me : in out; aValue : Integer from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: return &
|
||||
|
||||
PutCharacter(me : in out; aValue : Character from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutInteger(me : in out; aValue : Integer from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutBoolean(me : in out; aValue : Boolean from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutReal(me : in out; aValue : Real from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
PutShortReal(me : in out; aValue : ShortReal from Standard) returns like me
|
||||
raises StreamWriteError;
|
||||
---C++: alias operator <<
|
||||
---C++: return &
|
||||
|
||||
GetReference(me : in out; aValue : in out Integer from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: return &
|
||||
|
||||
GetCharacter(me : in out; aValue : in out Character from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetExtCharacter(me : in out; aValue : in out ExtCharacter from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetInteger(me : in out; aValue : in out Integer from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetReal(me : in out; aValue :in out Real from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns like me
|
||||
raises StreamTypeMismatchError;
|
||||
---C++: alias operator >>
|
||||
---C++: return &
|
||||
|
||||
Close(me : in out) returns Error from Storage;
|
||||
---Purpose:
|
||||
-- Closes the file driven by this driver. This file was
|
||||
-- opened by the last call to the function Open.
|
||||
-- The function returns Storage_VSOk if the
|
||||
-- closure is correctly done, or any other value of
|
||||
-- the Storage_Error enumeration which specifies the problem encountered.
|
||||
Destroy(me : in out);
|
||||
---C++: alias ~
|
||||
|
||||
ReadLine(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read from the current position to the end of line.
|
||||
|
||||
ReadWord(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read from the current position to the next white space or end of line.
|
||||
|
||||
ReadExtendedLine(me : in out; buffer : in out ExtendedString from TCollection)
|
||||
raises StreamExtCharParityError
|
||||
is protected;
|
||||
---Purpose: read extended chars (unicode) from the current position to the end of line.
|
||||
|
||||
WriteExtendedLine(me : in out; buffer : ExtendedString from TCollection) is protected;
|
||||
---Purpose: write from the current position to the end of line.
|
||||
|
||||
ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected;
|
||||
---Purpose: read <rsize> character from the current position.
|
||||
|
||||
ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected;
|
||||
---Purpose: read from the first none space character position to the end of line.
|
||||
|
||||
FlushEndOfLine(me : in out) is protected;
|
||||
|
||||
FindTag(me : in out; aTag : CString from Standard) returns Error from Storage is protected;
|
||||
|
||||
MagicNumber(myclass)
|
||||
returns CString from Standard is private;
|
||||
---C++: return const
|
||||
|
||||
fields
|
||||
|
||||
myStream : FStream from FSD;
|
||||
end;
|
@@ -12,8 +12,16 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <FSD_File.ixx>
|
||||
|
||||
#include <FSD_File.hxx>
|
||||
#include <OSD.hxx>
|
||||
#include <Storage_BaseDriver.hxx>
|
||||
#include <Storage_StreamExtCharParityError.hxx>
|
||||
#include <Storage_StreamFormatError.hxx>
|
||||
#include <Storage_StreamTypeMismatchError.hxx>
|
||||
#include <Storage_StreamWriteError.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
const Standard_CString MAGICNUMBER = "FSDFILE";
|
||||
const Standard_CString ENDOFNORMALEXTENDEDSECTION = "BEGIN_REF_SECTION";
|
||||
|
320
src/FSD/FSD_File.hxx
Normal file
320
src/FSD/FSD_File.hxx
Normal file
@@ -0,0 +1,320 @@
|
||||
// Created on: 1996-11-29
|
||||
// Created by: Christophe LEYNADIER
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _FSD_File_HeaderFile
|
||||
#define _FSD_File_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <FSD_FStream.hxx>
|
||||
#include <Storage_BaseDriver.hxx>
|
||||
#include <Storage_Error.hxx>
|
||||
#include <Storage_OpenMode.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Storage_Position.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||
#include <Standard_Character.hxx>
|
||||
#include <Standard_ExtCharacter.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_Size.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class Storage_StreamTypeMismatchError;
|
||||
class Storage_StreamFormatError;
|
||||
class Storage_StreamWriteError;
|
||||
class Storage_StreamExtCharParityError;
|
||||
class TCollection_AsciiString;
|
||||
class TCollection_ExtendedString;
|
||||
class Storage_BaseDriver;
|
||||
|
||||
|
||||
|
||||
//! A general driver which defines as a file, the
|
||||
//! physical container for data to be stored or retrieved.
|
||||
class FSD_File : public Storage_BaseDriver
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Constructs a driver defining as a file, the physical
|
||||
//! container for data to be stored or retrieved.
|
||||
//! Use the function Open to give the name of the driven file.
|
||||
Standard_EXPORT FSD_File();
|
||||
|
||||
|
||||
//! Assigns as aName the name of the file to be
|
||||
//! driven by this driver. aMode precises if the file is
|
||||
//! opened in read or write mode.
|
||||
//! The function returns Storage_VSOk if the file
|
||||
//! is opened correctly, or any other value of the
|
||||
//! Storage_Error enumeration which specifies the problem encountered.
|
||||
Standard_EXPORT Storage_Error Open (const TCollection_AsciiString& aName, const Storage_OpenMode aMode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsEnd();
|
||||
|
||||
//! return position in the file. Return -1 upon error.
|
||||
Standard_EXPORT Storage_Position Tell();
|
||||
|
||||
Standard_EXPORT static Storage_Error IsGoodFileType (const TCollection_AsciiString& aName);
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteInfoSection();
|
||||
|
||||
Standard_EXPORT 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);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteInfoSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadInfoSection();
|
||||
|
||||
Standard_EXPORT 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);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadInfoSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteCommentSection();
|
||||
|
||||
Standard_EXPORT void WriteComment (const TColStd_SequenceOfExtendedString& userComments);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteCommentSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadCommentSection();
|
||||
|
||||
Standard_EXPORT void ReadComment (TColStd_SequenceOfExtendedString& userComments);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadCommentSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteTypeSection();
|
||||
|
||||
Standard_EXPORT void SetTypeSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteTypeInformations (const Standard_Integer typeNum, const TCollection_AsciiString& typeName);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteTypeSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadTypeSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer TypeSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadTypeInformations (Standard_Integer& typeNum, TCollection_AsciiString& typeName);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadTypeSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteRootSection();
|
||||
|
||||
Standard_EXPORT void SetRootSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteRoot (const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& aType);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteRootSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadRootSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer RootSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadRoot (TCollection_AsciiString& rootName, Standard_Integer& aRef, TCollection_AsciiString& aType);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadRootSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteRefSection();
|
||||
|
||||
Standard_EXPORT void SetRefSectionSize (const Standard_Integer aSize);
|
||||
|
||||
Standard_EXPORT void WriteReferenceType (const Standard_Integer reference, const Standard_Integer typeNum);
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteRefSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadRefSection();
|
||||
|
||||
Standard_EXPORT Standard_Integer RefSectionSize();
|
||||
|
||||
Standard_EXPORT void ReadReferenceType (Standard_Integer& reference, Standard_Integer& typeNum);
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadRefSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginWriteDataSection();
|
||||
|
||||
Standard_EXPORT void WritePersistentObjectHeader (const Standard_Integer aRef, const Standard_Integer aType);
|
||||
|
||||
Standard_EXPORT void BeginWritePersistentObjectData();
|
||||
|
||||
Standard_EXPORT void BeginWriteObjectData();
|
||||
|
||||
Standard_EXPORT void EndWriteObjectData();
|
||||
|
||||
Standard_EXPORT void EndWritePersistentObjectData();
|
||||
|
||||
Standard_EXPORT Storage_Error EndWriteDataSection();
|
||||
|
||||
Standard_EXPORT Storage_Error BeginReadDataSection();
|
||||
|
||||
Standard_EXPORT void ReadPersistentObjectHeader (Standard_Integer& aRef, Standard_Integer& aType);
|
||||
|
||||
Standard_EXPORT void BeginReadPersistentObjectData();
|
||||
|
||||
Standard_EXPORT void BeginReadObjectData();
|
||||
|
||||
Standard_EXPORT void EndReadObjectData();
|
||||
|
||||
Standard_EXPORT void EndReadPersistentObjectData();
|
||||
|
||||
Standard_EXPORT Storage_Error EndReadDataSection();
|
||||
|
||||
Standard_EXPORT void SkipObject();
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutReference (const Standard_Integer aValue);
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutCharacter (const Standard_Character aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Character aValue)
|
||||
{
|
||||
return PutCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutExtCharacter (const Standard_ExtCharacter aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_ExtCharacter aValue)
|
||||
{
|
||||
return PutExtCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutInteger (const Standard_Integer aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Integer aValue)
|
||||
{
|
||||
return PutInteger(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutBoolean (const Standard_Boolean aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Boolean aValue)
|
||||
{
|
||||
return PutBoolean(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutReal (const Standard_Real aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_Real aValue)
|
||||
{
|
||||
return PutReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& PutShortReal (const Standard_ShortReal aValue);
|
||||
Storage_BaseDriver& operator << (const Standard_ShortReal aValue)
|
||||
{
|
||||
return PutShortReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetReference (Standard_Integer& aValue);
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetCharacter (Standard_Character& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Character& aValue)
|
||||
{
|
||||
return GetCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetExtCharacter (Standard_ExtCharacter& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_ExtCharacter& aValue)
|
||||
{
|
||||
return GetExtCharacter(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetInteger (Standard_Integer& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Integer& aValue)
|
||||
{
|
||||
return GetInteger(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetBoolean (Standard_Boolean& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Boolean& aValue)
|
||||
{
|
||||
return GetBoolean(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetReal (Standard_Real& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_Real& aValue)
|
||||
{
|
||||
return GetReal(aValue);
|
||||
}
|
||||
|
||||
Standard_EXPORT Storage_BaseDriver& GetShortReal (Standard_ShortReal& aValue);
|
||||
Storage_BaseDriver& operator >> (Standard_ShortReal& aValue)
|
||||
{
|
||||
return GetShortReal(aValue);
|
||||
}
|
||||
|
||||
|
||||
//! Closes the file driven by this driver. This file was
|
||||
//! opened by the last call to the function Open.
|
||||
//! The function returns Storage_VSOk if the
|
||||
//! closure is correctly done, or any other value of
|
||||
//! the Storage_Error enumeration which specifies the problem encountered.
|
||||
Standard_EXPORT Storage_Error Close();
|
||||
|
||||
Standard_EXPORT void Destroy();
|
||||
~FSD_File()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! read from the current position to the end of line.
|
||||
Standard_EXPORT void ReadLine (TCollection_AsciiString& buffer);
|
||||
|
||||
//! read from the current position to the next white space or end of line.
|
||||
Standard_EXPORT void ReadWord (TCollection_AsciiString& buffer);
|
||||
|
||||
//! read extended chars (unicode) from the current position to the end of line.
|
||||
Standard_EXPORT void ReadExtendedLine (TCollection_ExtendedString& buffer);
|
||||
|
||||
//! write from the current position to the end of line.
|
||||
Standard_EXPORT void WriteExtendedLine (const TCollection_ExtendedString& buffer);
|
||||
|
||||
//! read <rsize> character from the current position.
|
||||
Standard_EXPORT void ReadChar (TCollection_AsciiString& buffer, const Standard_Size rsize);
|
||||
|
||||
//! read from the first none space character position to the end of line.
|
||||
Standard_EXPORT void ReadString (TCollection_AsciiString& buffer);
|
||||
|
||||
Standard_EXPORT void FlushEndOfLine();
|
||||
|
||||
Standard_EXPORT Storage_Error FindTag (const Standard_CString aTag);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT static const Standard_CString MagicNumber();
|
||||
|
||||
|
||||
FSD_FStream myStream;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _FSD_File_HeaderFile
|
Reference in New Issue
Block a user