From 78d2761615c811f241d2f49cc0a2fbadae789ee0 Mon Sep 17 00:00:00 2001 From: msv Date: Mon, 25 Apr 2016 13:00:05 +0300 Subject: [PATCH] Porting the fix 26229 to OCCT 6.9.1 --- .../BinLDrivers_DocumentRetrievalDriver.cdl | 14 +-- .../BinLDrivers_DocumentRetrievalDriver.cxx | 2 + .../BinLDrivers_DocumentStorageDriver.cdl | 8 +- src/CDF/CDF_Application.cdl | 5 +- src/CDM/CDM.cdl | 2 +- src/CDM/CDM_Document.cdl | 9 +- src/CDM/CDM_Reference.cdl | 2 +- src/FSD/FSD_BinaryFile.cdl | 105 +++++++++++++++++- src/FSD/FSD_BinaryFile.cxx | 9 ++ src/FSD/FSD_CmpFile.cdl | 8 +- src/FSD/FSD_File.cdl | 8 +- src/PCDM/PCDM.cdl | 5 + src/PCDM/PCDM_ReadWriter.cdl | 4 + src/PCDM/PCDM_Reader.cdl | 14 ++- src/PCDM/PCDM_RetrievalDriver.cdl | 11 +- src/PCDM/PCDM_StorageDriver.cdl | 7 +- src/PCDM/PCDM_Writer.cdl | 4 + src/Standard/Standard_Persistent_proto.hxx | 1 + src/Storage/Storage.cdl | 7 +- src/Storage/Storage_BaseDriver.cdl | 11 +- src/Storage/Storage_Data.cdl | 11 +- src/Storage/Storage_HeaderData.cdl | 10 +- src/Storage/Storage_InternalData.cdl | 5 +- src/Storage/Storage_InternalData.cxx | 4 + src/Storage/Storage_Root.cdl | 6 +- src/Storage/Storage_RootData.cdl | 3 +- src/Storage/Storage_TypeData.cdl | 6 +- src/TDocStd/TDocStd_Application.cdl | 20 +++- src/TDocStd/TDocStd_Application.cxx | 2 + src/XmlLDrivers/XmlLDrivers.cdl | 1 + .../XmlLDrivers_DocumentRetrievalDriver.cdl | 9 +- .../XmlLDrivers_DocumentRetrievalDriver.cxx | 1 + .../XmlLDrivers_DocumentStorageDriver.cdl | 11 +- 33 files changed, 270 insertions(+), 55 deletions(-) diff --git a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cdl b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cdl index dc67cc2536..c04a0758ab 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cdl +++ b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cdl @@ -18,6 +18,7 @@ class DocumentRetrievalDriver from BinLDrivers inherits RetrievalDriver from PCD uses HeaderData from Storage, Position from Storage, + Data from Storage, AsciiString from TCollection, ExtendedString from TCollection, Document from PCDM, @@ -57,6 +58,12 @@ is theApplication: Application from CDM) is redefined virtual; ---Purpose: retrieves the content of the file into a new Document. + Read(me:mutable; theIStream: in out IStream from Standard; + theStorageData: Data from Storage; + theNewDocument: Document from CDM; + theApplication: Application from CDM) is redefined virtual; + ---Purpose: retrieves the content of the stream into a new Document. + AttributeDrivers (me : mutable; theMsgDriver: MessageDriver from CDM) returns ADriverTable from BinMDF is virtual; @@ -69,13 +76,6 @@ is is virtual protected; ---Purpose: Read the tree from the stream to - ReadInfoSection(me: mutable; theFile : AsciiString from TCollection; - theData : in out HeaderData from Storage) - returns Position from Storage is protected; - ---Purpose: Read the info section of theFile into theData, - -- return a file position corresponding to the info - -- section end - ReadSection (me: mutable; theSection : in out DocumentSection from BinLDrivers; theDoc : Document from CDM; diff --git a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx index f0bc9df615..7f62f8984d 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx +++ b/src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx @@ -21,10 +21,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cdl b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cdl index 088f292142..39655a14b2 100644 --- a/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cdl +++ b/src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cdl @@ -47,6 +47,11 @@ is is redefined virtual; ---Purpose: Write to the binary file + Write(me: mutable; aDocument: Document from CDM; + theOStream: in out OStream from Standard) + is redefined virtual; + ---Purpose: Write to theOStream + AttributeDrivers (me : mutable; theMsgDriver: MessageDriver from CDM) returns ADriverTable from BinMDF is virtual; @@ -82,7 +87,7 @@ is -- attributes to store WriteInfoSection(me: mutable; theDocument : Document from CDM; - theFile : AsciiString from TCollection) + theOS : in out OStream from Standard) is private; ---Purpose: Write info secton using FSD_BinaryFile driver @@ -109,5 +114,6 @@ fields myTypesMap : IndexedMapOfTransient from TColStd; mySections : VectorOfDocumentSection from BinLDrivers; + myFileName : ExtendedString from TCollection; end DocumentStorageDriver; diff --git a/src/CDF/CDF_Application.cdl b/src/CDF/CDF_Application.cdl index b321ab31c0..abca18606b 100644 --- a/src/CDF/CDF_Application.cdl +++ b/src/CDF/CDF_Application.cdl @@ -155,7 +155,10 @@ is Reader(me: mutable; aFileName: ExtendedString from TCollection) returns Reader from PCDM raises NoSuchObject from Standard; - + + Read(me: mutable; theIStream: in out IStream from Standard) + returns Document from CDM; + FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection) returns Boolean from Standard; diff --git a/src/CDM/CDM.cdl b/src/CDM/CDM.cdl index 7e5198e847..d6a61d0a96 100644 --- a/src/CDM/CDM.cdl +++ b/src/CDM/CDM.cdl @@ -50,7 +50,7 @@ is ---Purpose: this map will allows to get a directory object from a name. private pointer DocumentPointer to Document from CDM; - private class Reference; + class Reference; private class ListOfReferences instantiates List from TCollection(Reference from CDM); deferred class Application; diff --git a/src/CDM/CDM_Document.cdl b/src/CDM/CDM_Document.cdl index c9170923ef..a8a41da76e 100644 --- a/src/CDM/CDM_Document.cdl +++ b/src/CDM/CDM_Document.cdl @@ -448,8 +448,7 @@ is ---Category: private methods; -- Reference(me; aReferenceIdentifier: Integer from Standard) - returns Reference from CDM - is private; + returns Reference from CDM; ComputePresentation(me: mutable) is private; @@ -471,13 +470,11 @@ is RemoveFromReference(me: mutable; aReferenceIdentifier: Integer from Standard) is private; - SetModifications(me: mutable; Modifications: Integer from Standard) - is private; + SetModifications(me: mutable; Modifications: Integer from Standard); ReferenceCounter(me) returns Integer from Standard; - SetReferenceCounter(me: mutable; aReferenceCounter: Integer from Standard) - is private; + SetReferenceCounter(me: mutable; aReferenceCounter: Integer from Standard); ---Category: obsolete methods diff --git a/src/CDM/CDM_Reference.cdl b/src/CDM/CDM_Reference.cdl index 8efe4cb74b..74302cb19f 100644 --- a/src/CDM/CDM_Reference.cdl +++ b/src/CDM/CDM_Reference.cdl @@ -14,7 +14,7 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -private class Reference from CDM inherits Transient from Standard +class Reference from CDM inherits Transient from Standard uses Document from CDM, DocumentPointer from CDM, Application from CDM, MetaData from CDM diff --git a/src/FSD/FSD_BinaryFile.cdl b/src/FSD/FSD_BinaryFile.cdl index f096a5cc2a..5af22d072c 100644 --- a/src/FSD/FSD_BinaryFile.cdl +++ b/src/FSD/FSD_BinaryFile.cdl @@ -26,7 +26,10 @@ uses Position from Storage, SequenceOfExtendedString from TColStd, ExtendedString from TCollection, FileHeader from FSD, - BStream from FSD + BStream from FSD, + Data from Storage, + OStream from Standard, + HeaderData from Storage raises StreamTypeMismatchError from Storage, StreamFormatError from Storage, @@ -61,8 +64,24 @@ is objectType : ExtendedString from TCollection; userInfo : SequenceOfAsciiString from TColStd) raises StreamWriteError; + + WriteInfo(myclass; theOStream: in out OStream from Standard; + 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; + theOnlyCount: Boolean = Standard_False) + returns Integer raises StreamWriteError; EndWriteInfoSection(me : in out) returns Error from Storage; + + EndWriteInfoSection(me : in out; theOStream: in out OStream from Standard) + returns Error from Storage; -- read -- @@ -79,6 +98,9 @@ is userInfo : in out SequenceOfAsciiString from TColStd) raises StreamTypeMismatchError,StreamExtCharParityError; + ReadCompleteInfo(me: in out; theIStream: in out IStream from Standard; + theData: out Data from Storage) is redefined virtual; + EndReadInfoSection(me : in out) returns Error from Storage; -- COMMENTS SECTION @@ -86,10 +108,21 @@ is -- BeginWriteCommentSection(me : in out) returns Error from Storage; + BeginWriteCommentSection(me : in out; theOStream: in out OStream from Standard) + returns Error from Storage; + WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd) raises StreamWriteError; + + WriteComment(myclass; theOStream: in out OStream from Standard; + userComments : SequenceOfExtendedString from TColStd; + theOnlyCount: Boolean = Standard_False) + returns Integer raises StreamWriteError; EndWriteCommentSection(me : in out) returns Error from Storage; + + EndWriteCommentSection(me : in out; theOStream: in out OStream from Standard) + returns Error from Storage; -- read -- @@ -97,6 +130,10 @@ is ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd) raises StreamTypeMismatchError,StreamExtCharParityError; + + ReadComment(myclass; theIStream: in out IStream from Standard; + userComments : in out SequenceOfExtendedString from TColStd) + raises StreamTypeMismatchError,StreamExtCharParityError; EndReadCommentSection(me : in out) returns Error from Storage; @@ -118,9 +155,17 @@ is TypeSectionSize(me : in out) returns Integer from Standard raises StreamTypeMismatchError; + + TypeSectionSize(myclass; theIStream: in out IStream from Standard) returns Integer from Standard + raises StreamTypeMismatchError; ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection) raises StreamTypeMismatchError; + + ReadTypeInformations(myclass; theIStream: in out IStream from Standard; + typeNum : in out Integer from Standard; + typeName : in out AsciiString from TCollection) + raises StreamTypeMismatchError; EndReadTypeSection(me : in out) returns Error from Storage; @@ -143,9 +188,18 @@ is RootSectionSize(me : in out) returns Integer from Standard raises StreamTypeMismatchError; + + RootSectionSize(myclass; theIStream: in out IStream from Standard) 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; + + ReadRoot(myclass; theIStream: in out IStream from Standard; + 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; @@ -168,9 +222,17 @@ is RefSectionSize(me : in out) returns Integer from Standard raises StreamTypeMismatchError; + + RefSectionSize(myclass; theIStream: in out IStream from Standard) returns Integer from Standard + raises StreamTypeMismatchError; ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard) raises StreamTypeMismatchError; + + ReadReferenceType(myclass; theIStream: in out IStream from Standard; + reference : in out Integer from Standard; + typeNum : in out Integer from Standard) + raises StreamTypeMismatchError; EndReadRefSection(me : in out) returns Error from Storage; @@ -235,6 +297,11 @@ is ---C++: alias operator << ---C++: return & + PutInteger(myclass; theOStream: in out OStream from Standard; + aValue : Integer from Standard; + theOnlyCount: Boolean = Standard_False) returns Integer + raises StreamWriteError; + PutInteger(me : in out; aValue : Integer from Standard) returns like me raises StreamWriteError; ---C++: alias operator << @@ -259,6 +326,10 @@ is raises StreamTypeMismatchError; ---C++: return & + GetReference(myclass; theIStream: in out IStream from Standard; + aValue : in out Integer from Standard) + raises StreamTypeMismatchError; + GetCharacter(me : in out; aValue : in out Character from Standard) returns like me raises StreamTypeMismatchError; ---C++: alias operator >> @@ -273,6 +344,10 @@ is raises StreamTypeMismatchError; ---C++: alias operator >> ---C++: return & + + GetInteger(myclass; theIStream: in out IStream from Standard; + aValue : in out Integer from Standard) + raises StreamTypeMismatchError; GetBoolean(me : in out; aValue : in out Boolean from Standard) returns like me raises StreamTypeMismatchError; @@ -294,11 +369,27 @@ is Destroy(me : in out); ---C++: alias ~ + ReadHeader(myclass; theIStream: in out IStream from Standard; + theFileHeader: in out FileHeader from FSD ); + + ReadHeaderData(myclass; theIStream: in out IStream from Standard; + theHeaderData: HeaderData from Storage ); + + ReadString(myclass; theIStream: in out IStream from Standard; + theBuffer: out AsciiString from TCollection); + + ReadExtendedString(myclass; theIStream: in out IStream from Standard; + theBuffer: out ExtendedString from TCollection); + + WriteHeader(myclass; theOStream: in out OStream from Standard; + theFileHeader: FileHeader from FSD; + theOnlyCount: Boolean = Standard_False ) returns Integer; + WriteHeader(me : in out) is private; ReadHeader(me : in out) is private; MagicNumber(myclass) - returns CString from Standard is private; + returns CString from Standard; ---C++: return const ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected; @@ -310,11 +401,21 @@ is WriteString(me : in out; buffer : AsciiString from TCollection) is protected; ---Purpose: write string at the current position. + WriteString(myclass; theOStream: in out OStream from Standard; + theString : AsciiString from TCollection; + theOnlyCount: Boolean = Standard_False) returns Integer 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. + + WriteExtendedString(myclass; theOStream: in out OStream from Standard; + theString : ExtendedString from TCollection; + theOnlyCount: Boolean = Standard_False) returns Integer is protected; + ---Purpose: write string at the current position. fields diff --git a/src/FSD/FSD_BinaryFile.cxx b/src/FSD/FSD_BinaryFile.cxx index 6bf7e61a05..b931adaaed 100644 --- a/src/FSD/FSD_BinaryFile.cxx +++ b/src/FSD/FSD_BinaryFile.cxx @@ -15,6 +15,15 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include const Standard_CString MAGICNUMBER = "BINFILE"; diff --git a/src/FSD/FSD_CmpFile.cdl b/src/FSD/FSD_CmpFile.cdl index eb33186168..4bba9cfe46 100644 --- a/src/FSD/FSD_CmpFile.cdl +++ b/src/FSD/FSD_CmpFile.cdl @@ -25,7 +25,8 @@ uses Position from Storage, SequenceOfAsciiString from TColStd, SequenceOfExtendedString from TColStd, ExtendedString from TCollection, - FStream from FSD + FStream from FSD, + Data from Storage raises StreamTypeMismatchError from Storage, StreamFormatError from Storage, @@ -78,6 +79,9 @@ is userInfo : in out SequenceOfAsciiString from TColStd) raises StreamTypeMismatchError,StreamExtCharParityError; + ReadCompleteInfo(me: in out; theIStream: in out IStream from Standard; + theData: out Data from Storage) is redefined virtual; + EndReadInfoSection(me : in out) returns Error from Storage; -- COMMENTS SECTION @@ -318,7 +322,7 @@ is FindTag(me : in out; aTag : CString from Standard) returns Error from Storage is protected; MagicNumber(myclass) - returns CString from Standard is private; + returns CString from Standard; ---C++: return const RaiseError(me: in out ; theFailure: Type from Standard) is private; diff --git a/src/FSD/FSD_File.cdl b/src/FSD/FSD_File.cdl index 86eb8e197f..043500547a 100644 --- a/src/FSD/FSD_File.cdl +++ b/src/FSD/FSD_File.cdl @@ -27,7 +27,8 @@ uses Position from Storage, SequenceOfAsciiString from TColStd, SequenceOfExtendedString from TColStd, ExtendedString from TCollection, - FStream from FSD + FStream from FSD, + Data from Storage raises StreamTypeMismatchError from Storage, StreamFormatError from Storage, @@ -89,6 +90,9 @@ is userInfo : in out SequenceOfAsciiString from TColStd) raises StreamTypeMismatchError,StreamExtCharParityError; + ReadCompleteInfo(me: in out; theIStream: in out IStream from Standard; + theData: out Data from Storage) is redefined virtual; + EndReadInfoSection(me : in out) returns Error from Storage; -- COMMENTS SECTION @@ -334,7 +338,7 @@ is FindTag(me : in out; aTag : CString from Standard) returns Error from Storage is protected; MagicNumber(myclass) - returns CString from Standard is private; + returns CString from Standard; ---C++: return const fields diff --git a/src/PCDM/PCDM.cdl b/src/PCDM/PCDM.cdl index 9aae68f535..c60a50c763 100644 --- a/src/PCDM/PCDM.cdl +++ b/src/PCDM/PCDM.cdl @@ -108,4 +108,9 @@ is FileDriverType(aFileName: AsciiString from TCollection; aBaseDriver: out BaseDriverPointer from PCDM) returns TypeOfFileDriver from PCDM is private; + + FileDriverType(theIStream: in out IStream from Standard; aBaseDriver: out BaseDriverPointer from PCDM) + returns TypeOfFileDriver from PCDM + is private; + end PCDM; diff --git a/src/PCDM/PCDM_ReadWriter.cdl b/src/PCDM/PCDM_ReadWriter.cdl index 70eb68bbde..28ab81540e 100644 --- a/src/PCDM/PCDM_ReadWriter.cdl +++ b/src/PCDM/PCDM_ReadWriter.cdl @@ -85,4 +85,8 @@ is ---Purpose: tries to get a format in the file. returns an empty -- string if the file could not be read or does not have -- a FileFormat information. + + FileFormat(myclass; theIStream: in out IStream from Standard; theData: out Data from Storage) + returns ExtendedString from TCollection; + end ReadWriter from PCDM; diff --git a/src/PCDM/PCDM_Reader.cdl b/src/PCDM/PCDM_Reader.cdl index 9bab9f37cf..a35ac25ab6 100644 --- a/src/PCDM/PCDM_Reader.cdl +++ b/src/PCDM/PCDM_Reader.cdl @@ -21,8 +21,10 @@ uses Document from CDM, ExtendedString from TCollection, Application from CDM, - ReaderStatus from PCDM - + ReaderStatus from PCDM, + IStream from Standard, + Data from Storage + raises DriverError from PCDM @@ -38,6 +40,14 @@ is raises DriverError from PCDM is deferred; ---Purpose: retrieves the content of the file into a new Document. + + Read(me: mutable; theIStream: in out IStream from Standard; + theStorageData: Data from Storage; + aNewDocument: Document from CDM; + anApplication: Application from CDM) + raises DriverError from PCDM + is deferred; + ---Purpose: retrieves the content of the stream into a new Document. GetStatus(me) returns ReaderStatus from PCDM; ---C++: inline diff --git a/src/PCDM/PCDM_RetrievalDriver.cdl b/src/PCDM/PCDM_RetrievalDriver.cdl index 70dd291421..627d4baa70 100644 --- a/src/PCDM/PCDM_RetrievalDriver.cdl +++ b/src/PCDM/PCDM_RetrievalDriver.cdl @@ -27,7 +27,9 @@ uses SequenceOfReference from PCDM, Schema from Storage, MessageDriver from CDM, - Application from CDM + Application from CDM, + IStream from Standard, + Data from Storage raises NoSuchObject from Standard, DriverError from PCDM @@ -48,6 +50,13 @@ is -- transient document. -- + Read(me: mutable; theIStream: in out IStream from Standard; + theStorageData: Data from Storage; + aNewDocument: Document from CDM; + anApplication: Application from CDM) + raises DriverError from PCDM + is redefined virtual; + Make(me : mutable; aPCDM: Document from PCDM; aNewDocument: Document from CDM) raises DriverError from PCDM is deferred; diff --git a/src/PCDM/PCDM_StorageDriver.cdl b/src/PCDM/PCDM_StorageDriver.cdl index 4b902ab812..622288cae9 100644 --- a/src/PCDM/PCDM_StorageDriver.cdl +++ b/src/PCDM/PCDM_StorageDriver.cdl @@ -41,7 +41,8 @@ uses Schema from Storage, SequenceOfExtendedString from TColStd, SequenceOfDocument from PCDM, - StoreStatus from PCDM + StoreStatus from PCDM, + OStream from Standard raises NoSuchObject from Standard,DriverError from PCDM is @@ -76,6 +77,10 @@ is -- document and the Schema method to write the persistent document. -- + Write(me: mutable; aDocument: Document from CDM; theOStream: in out OStream from Standard) + raises DriverError + is redefined virtual; + SetFormat (me : mutable; aformat : ExtendedString from TCollection); GetFormat (me) diff --git a/src/PCDM/PCDM_Writer.cdl b/src/PCDM/PCDM_Writer.cdl index 75d0330db4..7dc1c64660 100644 --- a/src/PCDM/PCDM_Writer.cdl +++ b/src/PCDM/PCDM_Writer.cdl @@ -25,4 +25,8 @@ is raises DriverError is deferred; + Write(me: mutable; aDocument: Document from CDM; theOStream: in out OStream from Standard) + raises DriverError + is deferred; + end Writer from PCDM; diff --git a/src/Standard/Standard_Persistent_proto.hxx b/src/Standard/Standard_Persistent_proto.hxx index a73b70fa18..8d3428f52c 100644 --- a/src/Standard/Standard_Persistent_proto.hxx +++ b/src/Standard/Standard_Persistent_proto.hxx @@ -52,6 +52,7 @@ public: Standard_EXPORT virtual const Handle_Standard_Type& DynamicType() const; Standard_EXPORT Standard_Boolean IsKind(const Handle_Standard_Type&)const; Standard_EXPORT Standard_Boolean IsInstance(const Handle_Standard_Type&)const; + Standard_Integer& TypeNum() { return _typenum; } }; #include diff --git a/src/Storage/Storage.cdl b/src/Storage/Storage.cdl index cdb172530b..15c18e00ca 100644 --- a/src/Storage/Storage.cdl +++ b/src/Storage/Storage.cdl @@ -134,9 +134,10 @@ is class HSeqOfRoot instantiates HSequence from TCollection(Root from Storage,SeqOfRoot); + class InternalData; + -- PRIVATE - private class InternalData; private class stCONSTclCOM; private class TypedCallBack; @@ -159,8 +160,8 @@ is class ArrayOfSchema instantiates Array1 from TCollection(Schema from Storage); class HArrayOfSchema instantiates HArray1 from TCollection(Schema from Storage,ArrayOfSchema from Storage); - private class PArray instantiates Array1 from TCollection(Persistent from Standard); - private class HPArray instantiates HArray1 from TCollection(Persistent from Standard, PArray from Storage); + class PArray instantiates Array1 from TCollection(Persistent from Standard); + class HPArray instantiates HArray1 from TCollection(Persistent from Standard, PArray from Storage); -- METHODS diff --git a/src/Storage/Storage_BaseDriver.cdl b/src/Storage/Storage_BaseDriver.cdl index 3afdfbcd25..d935cdf7be 100644 --- a/src/Storage/Storage_BaseDriver.cdl +++ b/src/Storage/Storage_BaseDriver.cdl @@ -26,7 +26,9 @@ uses Position from Storage, Error from Storage, ExtendedString from TCollection, SequenceOfAsciiString from TColStd, - SequenceOfExtendedString from TColStd + SequenceOfExtendedString from TColStd, + IStream from Standard, + Data from Storage raises StreamTypeMismatchError from Storage, StreamFormatError from Storage, @@ -47,6 +49,9 @@ is OpenMode(me) returns OpenMode from Storage; ---C++: inline + ReadMagicNumber(myclass; theIStream: in out IStream from Standard) + returns AsciiString from TCollection; + IsEnd(me : in out) returns Boolean from Standard is deferred; ---Purpose: returns True if we are at end of the stream @@ -90,6 +95,10 @@ is raises StreamTypeMismatchError,StreamExtCharParityError is deferred; + ReadCompleteInfo(me: in out; theIStream: in out IStream from Standard; + theData: out Data from Storage) + is deferred; + EndReadInfoSection(me : in out) returns Error from Storage is deferred; diff --git a/src/Storage/Storage_Data.cdl b/src/Storage/Storage_Data.cdl index 83a33e302b..ef43d8e861 100644 --- a/src/Storage/Storage_Data.cdl +++ b/src/Storage/Storage_Data.cdl @@ -215,13 +215,14 @@ is ---Purpose: -- Gives the list of types of objects used in this set of data in a sequence. + HeaderData(me) returns HeaderData from Storage; + RootData(me) returns RootData from Storage; + TypeData(me) returns TypeData from Storage; + InternalData(me) returns InternalData from Storage; + Clear(me); + -- PRIVATE - HeaderData(me) returns HeaderData from Storage is private; - RootData(me) returns RootData from Storage is private; - TypeData(me) returns TypeData from Storage is private; - InternalData(me) returns InternalData from Storage is private; - Clear(me) is private; SetErrorStatus(me : mutable; anError : Error from Storage) is private; SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private; diff --git a/src/Storage/Storage_HeaderData.cdl b/src/Storage/Storage_HeaderData.cdl index ba62a92feb..ce02fd3d25 100644 --- a/src/Storage/Storage_HeaderData.cdl +++ b/src/Storage/Storage_HeaderData.cdl @@ -82,14 +82,14 @@ is ClearErrorStatus(me : mutable); + SetNumberOfObjects(me : mutable; anObjectNumber : Integer from Standard); + SetStorageVersion(me : mutable; aVersion : AsciiString from TCollection); + SetCreationDate(me : mutable; aDate : AsciiString from TCollection); + SetSchemaVersion(me : mutable; aVersion : AsciiString from TCollection); + SetSchemaName(me : mutable; aName : AsciiString from TCollection); -- PRIVATE - SetNumberOfObjects(me : mutable; anObjectNumber : Integer from Standard) is private; - SetStorageVersion(me : mutable; aVersion : AsciiString from TCollection) is private; - SetCreationDate(me : mutable; aDate : AsciiString from TCollection) is private; - SetSchemaVersion(me : mutable; aVersion : AsciiString from TCollection) is private; - SetSchemaName(me : mutable; aName : AsciiString from TCollection) is private; SetErrorStatus(me : mutable; anError : Error from Storage) is private; SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private; diff --git a/src/Storage/Storage_InternalData.cdl b/src/Storage/Storage_InternalData.cdl index 3b2d2fe38b..57de3c44fe 100644 --- a/src/Storage/Storage_InternalData.cdl +++ b/src/Storage/Storage_InternalData.cdl @@ -14,7 +14,7 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -private class InternalData from Storage +class InternalData from Storage inherits TShared from MMgt @@ -23,6 +23,9 @@ uses BucketOfPersistent from Storage, MapOfCallBack from Storage is Create returns InternalData from Storage; + + ReadArray(me: mutable) returns HPArray from Storage; + ---C++: return & Clear(me : mutable); diff --git a/src/Storage/Storage_InternalData.cxx b/src/Storage/Storage_InternalData.cxx index 1b00b9648f..da15ab18e6 100644 --- a/src/Storage/Storage_InternalData.cxx +++ b/src/Storage/Storage_InternalData.cxx @@ -27,3 +27,7 @@ void Storage_InternalData::Clear() myTypeBinding.Clear(); } +Handle(Storage_HPArray)& Storage_InternalData::ReadArray() +{ + return myReadArray; +} diff --git a/src/Storage/Storage_Root.cdl b/src/Storage/Storage_Root.cdl index 5d15895c9b..921061acdf 100644 --- a/src/Storage/Storage_Root.cdl +++ b/src/Storage/Storage_Root.cdl @@ -64,9 +64,9 @@ is Type(me) returns AsciiString from TCollection; ---Purpose: Returns the name of this root type. - SetReference(me : mutable; aRef : Integer from Standard) is private; - Reference(me) returns Integer from Standard is private; - SetType(me : mutable; aType : AsciiString from TCollection) is private; + SetReference(me : mutable; aRef : Integer from Standard); + Reference(me) returns Integer from Standard; + SetType(me : mutable; aType : AsciiString from TCollection); fields diff --git a/src/Storage/Storage_RootData.cdl b/src/Storage/Storage_RootData.cdl index 0ec652a757..82ace4e4ca 100644 --- a/src/Storage/Storage_RootData.cdl +++ b/src/Storage/Storage_RootData.cdl @@ -57,8 +57,7 @@ is -- PRIVATE UpdateRoot(me : mutable; aName : AsciiString from TCollection; aPers : Persistent from Standard) - raises NoSuchObject - is private; + raises NoSuchObject; SetErrorStatus(me : mutable; anError : Error from Storage) is private; SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private; diff --git a/src/Storage/Storage_TypeData.cdl b/src/Storage/Storage_TypeData.cdl index bade8ef5ef..fdbe28bdb6 100644 --- a/src/Storage/Storage_TypeData.cdl +++ b/src/Storage/Storage_TypeData.cdl @@ -42,15 +42,15 @@ is -- PRIVATE - AddType(me : mutable; aName : AsciiString from TCollection; aTypeNum : Integer from Standard) is private; + AddType(me : mutable; aName : AsciiString from TCollection; aTypeNum : Integer from Standard); ---Purpose: add a type to the list Type(me; aTypeNum : Integer from Standard) returns AsciiString from TCollection - raises NoSuchObject is private; + raises NoSuchObject; ---Purpose: returns the name of the type with number Type(me; aTypeName : AsciiString from TCollection) returns Integer from Standard - raises NoSuchObject is private; + raises NoSuchObject; ---Purpose: returns the name of the type with number SetErrorStatus(me : mutable; anError : Error from Storage) is private; diff --git a/src/TDocStd/TDocStd_Application.cdl b/src/TDocStd/TDocStd_Application.cdl index 700360d068..bc812b329c 100644 --- a/src/TDocStd/TDocStd_Application.cdl +++ b/src/TDocStd/TDocStd_Application.cdl @@ -52,7 +52,9 @@ uses Manager from Resource, ExtendedString from TCollection, SequenceOfExtendedString from TColStd, ReaderStatus from PCDM, - StoreStatus from PCDM + StoreStatus from PCDM, + IStream from Standard, + OStream from Standard raises NoSuchObject from Standard @@ -192,11 +194,21 @@ is -- to depend on the value returned by IsInSession. returns ReaderStatus from PCDM; + Open (me : mutable; theIStream: in out IStream from Standard; + aDoc : out Document from TDocStd) + ---Purpose: Retrieves aDoc from standard SEEKABLE stream theIStream. + returns ReaderStatus from PCDM; + SaveAs (me : mutable; aDoc : Document from TDocStd; path : ExtendedString from TCollection) ---Purpose: Save the active document in the file in the -- path ; o verwrites the file if it already exists. returns StoreStatus from PCDM; + + SaveAs (me : mutable; aDoc : Document from TDocStd; + theOStream : in out OStream from Standard) + ---Purpose: Save theDoc to standard SEEKABLE stream theOStream. + returns StoreStatus from PCDM; Save (me : mutable; aDoc : Document from TDocStd) @@ -213,6 +225,12 @@ is -- path . overwrite the file if it -- already exist. returns StoreStatus from PCDM; + + SaveAs (me : mutable; aDoc : Document from TDocStd; + theOStream : in out OStream from Standard; + theStatusMessage: out ExtendedString from TCollection) + ---Purpose: Save theDoc to standard SEEKABLE stream theOStream. + returns StoreStatus from PCDM; Save (me : mutable; aDoc : Document from TDocStd; theStatusMessage: out ExtendedString from TCollection) diff --git a/src/TDocStd/TDocStd_Application.cxx b/src/TDocStd/TDocStd_Application.cxx index 4005d3e5c1..28f2e9af79 100644 --- a/src/TDocStd/TDocStd_Application.cxx +++ b/src/TDocStd/TDocStd_Application.cxx @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/XmlLDrivers/XmlLDrivers.cdl b/src/XmlLDrivers/XmlLDrivers.cdl index 9b4514ecb0..17967a006b 100644 --- a/src/XmlLDrivers/XmlLDrivers.cdl +++ b/src/XmlLDrivers/XmlLDrivers.cdl @@ -17,6 +17,7 @@ package XmlLDrivers uses Standard, + Storage, TDF, TDocStd, TCollection, diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cdl b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cdl index 53ea25c661..7692fa4d22 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cdl +++ b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cdl @@ -26,7 +26,9 @@ uses ADriverTable from XmlMDF, RRelocationTable from XmlObjMgt, Element from XmlObjMgt, - MessageDriver from CDM + MessageDriver from CDM, + IStream from Standard, + Data from Storage is Create returns DocumentRetrievalDriver from XmlLDrivers; @@ -50,6 +52,11 @@ is theApplication: Application from CDM) is redefined virtual; -- + Read(me:mutable; theIStream: in out IStream from Standard; + theData: Data from Storage; + theNewDocument: Document from CDM; + theApplication: Application from CDM) is redefined virtual; + ReadFromDomDocument (me : mutable; theDomElement: Element from XmlObjMgt; theNewDocument: Document from CDM; theApplication: Application from CDM) diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx index 3842cea943..7510271432 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx +++ b/src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef WNT # include diff --git a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cdl b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cdl index ae6c94fb47..04311dc7c6 100644 --- a/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cdl +++ b/src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cdl @@ -25,7 +25,8 @@ uses Element from XmlObjMgt, SRelocationTable from XmlObjMgt, ADriverTable from XmlMDF, - MessageDriver from CDM + MessageDriver from CDM, + OStream from Standard is Create (theCopyright: ExtendedString from TCollection) @@ -40,9 +41,12 @@ is is redefined virtual; -- Write to the xml file + Write (me: mutable;theDocument: Document from CDM; + theOStream: in out OStream from Standard) + is redefined virtual; + WriteToDomDocument(me:mutable; theDocument: Document from CDM; - thePDoc : out Element from XmlObjMgt; - theFileName: ExtendedString from TCollection) + thePDoc : out Element from XmlObjMgt) returns Boolean from Standard is virtual protected; @@ -67,5 +71,6 @@ fields mySeqOfNS : SequenceOfNamespaceDef from XmlLDrivers; myCopyright : ExtendedString from TCollection; myRelocTable: SRelocationTable from XmlObjMgt is protected; + myFileName : ExtendedString from TCollection; end DocumentStorageDriver; -- 2.39.5