1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +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:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,4 +1,30 @@
PCDM_DOMHeaderParser.hxx
PCDM.cxx
PCDM.hxx
PCDM_BaseDriverPointer.hxx
PCDM_Document.cxx
PCDM_Document.hxx
PCDM_DOMHeaderParser.cxx
PCDM_DOMHeaderParser.hxx
PCDM_DriverError.hxx
PCDM_Reader.cxx
PCDM_Reader.hxx
PCDM_Reader.lxx
PCDM_ReaderStatus.hxx
PCDM_ReadWriter.cxx
PCDM_ReadWriter.hxx
PCDM_ReadWriter_1.cxx
PCDM_ReadWriter_1.hxx
PCDM_Reference.cxx
PCDM_Reference.hxx
PCDM_ReferenceIterator.cxx
PCDM_ReferenceIterator.hxx
PCDM_RetrievalDriver.cxx
PCDM_RetrievalDriver.hxx
PCDM_SequenceOfDocument.hxx
PCDM_SequenceOfReference.hxx
PCDM_StorageDriver.cxx
PCDM_StorageDriver.hxx
PCDM_StoreStatus.hxx
PCDM_TypeOfFileDriver.hxx
PCDM_Writer.cxx
PCDM_Writer.hxx

View File

@@ -1,111 +0,0 @@
-- Created on: 1997-08-01
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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 PCDM
uses
CDM,TColStd,TCollection,Storage
is
enumeration ReaderStatus is
RS_OK,
RS_NoDriver,
RS_UnknownFileDriver,
RS_OpenError,
RS_NoVersion,
RS_NoSchema,
RS_NoDocument,
RS_ExtensionFailure,
RS_WrongStreamMode,
RS_FormatFailure,
RS_TypeFailure,
RS_TypeNotFoundInSchema,
RS_UnrecognizedFileFormat,
RS_MakeFailure,
RS_PermissionDenied,
RS_DriverFailure,
RS_AlreadyRetrievedAndModified,
RS_AlreadyRetrieved,
RS_UnknownDocument,
RS_WrongResource,
RS_ReaderException,
RS_NoModel
end ReaderStatus;
enumeration StoreStatus is
SS_OK,
SS_DriverFailure,
SS_WriteFailure,
SS_Failure,
SS_Doc_IsNull,
SS_No_Obj,
SS_Info_Section_Error
end StoreStatus;
deferred class Document;
imported SequenceOfDocument;
deferred class Reader;
deferred class Writer;
deferred class RetrievalDriver;
deferred class StorageDriver;
class ReferenceIterator;
---Category: exceptions
exception DriverError inherits Failure from Standard;
---Category: classes for versioning reading/writing og the headers.
private class Reference;
imported SequenceOfReference;
private deferred class ReadWriter;
private class ReadWriter_1;
---Category: type of FileDriver;
--
private enumeration TypeOfFileDriver is TOFD_File, TOFD_CmpFile, TOFD_Unknown
end TypeOfFileDriver from PCDM;
private pointer BaseDriverPointer to BaseDriver from Storage;
---Category: drivers plugin.
--
FindStorageDriver(aDocument: Document from CDM)
returns Boolean from Standard;
StorageDriver(aDocument: Document from CDM)
returns StorageDriver from PCDM
raises NoSuchObject from Standard;
---Purpose: gets in the EuclidDesktop resource the plugin
-- identifier of the driver plugs the driver.
--
Schema(aSchemaName: ExtendedString from TCollection;
anApplication: Application from CDM)
---Purpose: returns a schema to be used during a Store or Retrieve
-- operation.
-- Schema will plug the schema defined by
-- the SchemaName method.
returns Schema from Storage;
FileDriverType(aFileName: AsciiString from TCollection; aBaseDriver: out BaseDriverPointer from PCDM)
returns TypeOfFileDriver from PCDM
is private;
end PCDM;

View File

@@ -14,24 +14,29 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM.ixx>
#include <Plugin.hxx>
#include <Standard_SStream.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Resource_Manager.hxx>
#include <Standard_GUID.hxx>
#include <UTL.hxx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <FSD_BinaryFile.hxx>
#include <FSD_CmpFile.hxx>
#include <FSD_File.hxx>
#include <FSD_BinaryFile.hxx>
#include <PCDM.hxx>
#include <PCDM_StorageDriver.hxx>
#include <Plugin.hxx>
#include <Resource_Manager.hxx>
#include <Standard_GUID.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_SStream.hxx>
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <UTL.hxx>
//=======================================================================
//function : StorageDriver
//purpose : gets in the EuclidDesktop resource the plugin
// identifier of the driver plugs the driver.
//=======================================================================
Handle(PCDM_StorageDriver) PCDM::StorageDriver(const Handle(CDM_Document)& aDocument) {
if(!PCDM::FindStorageDriver(aDocument)) {

98
src/PCDM/PCDM.hxx Normal file
View File

@@ -0,0 +1,98 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_HeaderFile
#define _PCDM_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <PCDM_TypeOfFileDriver.hxx>
#include <PCDM_BaseDriverPointer.hxx>
class CDM_Document;
class PCDM_StorageDriver;
class Storage_Schema;
class TCollection_ExtendedString;
class CDM_Application;
class TCollection_AsciiString;
class PCDM_Document;
class PCDM_Reader;
class PCDM_Writer;
class PCDM_RetrievalDriver;
class PCDM_StorageDriver;
class PCDM_ReferenceIterator;
class PCDM_Reference;
class PCDM_ReadWriter;
class PCDM_ReadWriter_1;
class PCDM
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static Standard_Boolean FindStorageDriver (const Handle(CDM_Document)& aDocument);
//! gets in the EuclidDesktop resource the plugin
//! identifier of the driver plugs the driver.
Standard_EXPORT static Handle(PCDM_StorageDriver) StorageDriver (const Handle(CDM_Document)& aDocument);
//! returns a schema to be used during a Store or Retrieve
//! operation.
//! Schema will plug the schema defined by
//! the SchemaName method.
Standard_EXPORT static Handle(Storage_Schema) Schema (const TCollection_ExtendedString& aSchemaName, const Handle(CDM_Application)& anApplication);
protected:
private:
Standard_EXPORT static PCDM_TypeOfFileDriver FileDriverType (const TCollection_AsciiString& aFileName, PCDM_BaseDriverPointer& aBaseDriver);
friend class PCDM_Document;
friend class PCDM_Reader;
friend class PCDM_Writer;
friend class PCDM_RetrievalDriver;
friend class PCDM_StorageDriver;
friend class PCDM_ReferenceIterator;
friend class PCDM_Reference;
friend class PCDM_ReadWriter;
friend class PCDM_ReadWriter_1;
};
#endif // _PCDM_HeaderFile

View File

@@ -0,0 +1,23 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_BaseDriverPointer_HeaderFile
#define _PCDM_BaseDriverPointer_HeaderFile
class Storage_BaseDriver;
typedef Storage_BaseDriver* PCDM_BaseDriverPointer;
#endif // _PCDM_BaseDriverPointer_HeaderFile

View File

@@ -1,23 +0,0 @@
-- Created on: 1997-08-01
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
deferred class Document from PCDM inherits Persistent from Standard
uses Document from CDM
is
end Document from PCDM;

View File

@@ -14,5 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_Document.ixx>
#include <PCDM_Document.hxx>
#include <Standard_Type.hxx>

View File

@@ -0,0 +1,59 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_Document_HeaderFile
#define _PCDM_Document_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Persistent.hxx>
class PCDM_Document;
DEFINE_STANDARD_HANDLE(PCDM_Document, Standard_Persistent)
class PCDM_Document : public Standard_Persistent
{
public:
DEFINE_STANDARD_RTTI(PCDM_Document,Standard_Persistent)
protected:
private:
};
#endif // _PCDM_Document_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_DriverError_HeaderFile
#define _PCDM_DriverError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Failure.hxx>
class PCDM_DriverError;
DEFINE_STANDARD_HANDLE(PCDM_DriverError, Standard_Failure)
#if !defined No_Exception && !defined No_PCDM_DriverError
#define PCDM_DriverError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) PCDM_DriverError::Raise(MESSAGE);
#else
#define PCDM_DriverError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(PCDM_DriverError, Standard_Failure)
#endif // _PCDM_DriverError_HeaderFile

View File

@@ -1,88 +0,0 @@
-- Created on: 1997-12-09
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
private deferred class ReadWriter from PCDM inherits Transient from Standard
uses
ExtendedString from TCollection,
AsciiString from TCollection,
Data from Storage,
Document from CDM,
MessageDriver from CDM,
SequenceOfExtendedString from TColStd,
BaseDriver from Storage,
OpenMode from Storage,
SequenceOfReference from PCDM
is
Version(me) returns AsciiString from TCollection
is deferred;
---Purpose: returns PCDM_ReadWriter_1.
WriteReferenceCounter(me; aData: Data from Storage; aDocument: Document from CDM)
is deferred;
WriteReferences(me; aData: Data from Storage; aDocument: Document from CDM; theReferencerFileName: ExtendedString from TCollection)
is deferred;
WriteExtensions(me; aData: Data from Storage; aDocument: Document from CDM)
is deferred;
WriteVersion(me; aData: Data from Storage; aDocument: Document from CDM)
is deferred;
ReadReferenceCounter(me; theFileName: ExtendedString from TCollection;
theMsgDriver: MessageDriver from CDM)
returns Integer from Standard
is deferred;
ReadReferences(me; aFileName: ExtendedString from TCollection; theReferences: in out SequenceOfReference from PCDM; theMsgDriver: MessageDriver from CDM)
is deferred;
ReadExtensions(me; aFileName: ExtendedString from TCollection; theExtensions: in out SequenceOfExtendedString from TColStd; theMsgDriver: MessageDriver from CDM)
is deferred;
ReadDocumentVersion(me; aFileName: ExtendedString from TCollection; theMsgDriver: MessageDriver from CDM)
returns Integer from Standard
is deferred;
---Category: commom methods
Open(myclass; aDriver: in out BaseDriver from Storage; aFileName: ExtendedString from TCollection; anOpenMode: OpenMode from Storage);
Reader(myclass; aFileName: ExtendedString from TCollection)
returns ReadWriter from PCDM;
---Purpose: returns the convenient Reader for a File.
--
Writer(myclass)
returns ReadWriter from PCDM;
WriteFileFormat(myclass; aData: Data from Storage; aDocument: Document from CDM);
FileFormat(myclass; aFileName: ExtendedString from TCollection)
returns ExtendedString from TCollection;
---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.
end ReadWriter from PCDM;

View File

@@ -14,16 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_ReadWriter.ixx>
#include <PCDM_ReadWriter_1.hxx>
#include <Storage_Schema.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_TypeData.hxx>
#include <UTL.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <CDM_Document.hxx>
#include <CDM_MessageDriver.hxx>
#include <PCDM.hxx>
#include <PCDM_DOMHeaderParser.hxx>
#include <PCDM_ReadWriter.hxx>
#include <PCDM_ReadWriter_1.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Type.hxx>
#include <Storage_BaseDriver.hxx>
#include <Storage_Data.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_Schema.hxx>
#include <Storage_TypeData.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <UTL.hxx>
#define FILE_FORMAT "FILE_FORMAT: "

View File

@@ -0,0 +1,102 @@
// Created on: 1997-12-09
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_ReadWriter_HeaderFile
#define _PCDM_ReadWriter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Integer.hxx>
#include <PCDM_SequenceOfReference.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <Storage_OpenMode.hxx>
class TCollection_AsciiString;
class Storage_Data;
class CDM_Document;
class TCollection_ExtendedString;
class CDM_MessageDriver;
class Storage_BaseDriver;
class PCDM_ReadWriter;
DEFINE_STANDARD_HANDLE(PCDM_ReadWriter, Standard_Transient)
class PCDM_ReadWriter : public Standard_Transient
{
public:
//! returns PCDM_ReadWriter_1.
Standard_EXPORT virtual TCollection_AsciiString Version() const = 0;
Standard_EXPORT virtual void WriteReferenceCounter (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument) const = 0;
Standard_EXPORT virtual void WriteReferences (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& theReferencerFileName) const = 0;
Standard_EXPORT virtual void WriteExtensions (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument) const = 0;
Standard_EXPORT virtual void WriteVersion (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument) const = 0;
Standard_EXPORT virtual Standard_Integer ReadReferenceCounter (const TCollection_ExtendedString& theFileName, const Handle(CDM_MessageDriver)& theMsgDriver) const = 0;
Standard_EXPORT virtual void ReadReferences (const TCollection_ExtendedString& aFileName, PCDM_SequenceOfReference& theReferences, const Handle(CDM_MessageDriver)& theMsgDriver) const = 0;
Standard_EXPORT virtual void ReadExtensions (const TCollection_ExtendedString& aFileName, TColStd_SequenceOfExtendedString& theExtensions, const Handle(CDM_MessageDriver)& theMsgDriver) const = 0;
Standard_EXPORT virtual Standard_Integer ReadDocumentVersion (const TCollection_ExtendedString& aFileName, const Handle(CDM_MessageDriver)& theMsgDriver) const = 0;
Standard_EXPORT static void Open (Storage_BaseDriver& aDriver, const TCollection_ExtendedString& aFileName, const Storage_OpenMode anOpenMode);
//! returns the convenient Reader for a File.
Standard_EXPORT static Handle(PCDM_ReadWriter) Reader (const TCollection_ExtendedString& aFileName);
Standard_EXPORT static Handle(PCDM_ReadWriter) Writer();
Standard_EXPORT static void WriteFileFormat (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument);
//! 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.
Standard_EXPORT static TCollection_ExtendedString FileFormat (const TCollection_ExtendedString& aFileName);
DEFINE_STANDARD_RTTI(PCDM_ReadWriter,Standard_Transient)
protected:
private:
};
#endif // _PCDM_ReadWriter_HeaderFile

View File

@@ -1,61 +0,0 @@
-- Created on: 1997-12-09
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
private class ReadWriter_1 from PCDM inherits ReadWriter from PCDM
uses
ExtendedString from TCollection,
AsciiString from TCollection,
Data from Storage,
Document from CDM,
MessageDriver from CDM,
SequenceOfExtendedString from TColStd,
SequenceOfReference from PCDM
is
Create returns ReadWriter_1 from PCDM;
Version(me) returns AsciiString from TCollection;
---Purpose: returns PCDM_ReadWriter_1.
WriteReferenceCounter(me; aData: Data from Storage; aDocument: Document from CDM);
WriteReferences(me; aData: Data from Storage; aDocument: Document from CDM; theReferencerFileName: ExtendedString from TCollection);
WriteExtensions(me; aData: Data from Storage; aDocument: Document from CDM);
WriteVersion(me; aData: Data from Storage; aDocument: Document from CDM);
ReadReferenceCounter(me; aFileName: ExtendedString from TCollection; theMsgDriver: MessageDriver from CDM)
returns Integer from Standard;
ReadReferences(me; aFileName: ExtendedString from TCollection; theReferences: in out SequenceOfReference from PCDM; theMsgDriver: MessageDriver from CDM);
ReadExtensions(me; aFileName: ExtendedString from TCollection; theExtensions: in out SequenceOfExtendedString from TColStd; theMsgDriver: MessageDriver from CDM);
ReadUserInfo(myclass; aFileName: ExtendedString from TCollection; Start, End: AsciiString from TCollection; theUserInfo:in out SequenceOfExtendedString from TColStd;theMsgDriver: MessageDriver from CDM)
is private;
ReadDocumentVersion(me; aFileName: ExtendedString from TCollection; theMsgDriver: MessageDriver from CDM)
returns Integer from Standard;
end ReadWriter_1 from PCDM;

View File

@@ -14,24 +14,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_ReadWriter_1.ixx>
#include <UTL.hxx>
#include <CDM_Document.hxx>
#include <CDM_MessageDriver.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_ReferenceIterator.hxx>
#include <OSD_Path.hxx>
#include <PCDM.hxx>
#include <PCDM_BaseDriverPointer.hxx>
#include <PCDM_ReadWriter_1.hxx>
#include <PCDM_Reference.hxx>
#include <PCDM_TypeOfFileDriver.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Type.hxx>
#include <Storage_Data.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <CDM_Document.hxx>
#include <CDM_ReferenceIterator.hxx>
#include <CDM_MetaData.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <Storage_Schema.hxx>
#include <Storage_HeaderData.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <PCDM_Reference.hxx>
#include <Standard_ErrorHandler.hxx>
#include <OSD_Path.hxx>
#include <PCDM_BaseDriverPointer.hxx>
#include <PCDM.hxx>
#include <PCDM_TypeOfFileDriver.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <UTL.hxx>
#define START_REF "START_REF"
#define END_REF "END_REF"

View File

@@ -0,0 +1,90 @@
// Created on: 1997-12-09
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_ReadWriter_1_HeaderFile
#define _PCDM_ReadWriter_1_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <PCDM_ReadWriter.hxx>
#include <Standard_Integer.hxx>
#include <PCDM_SequenceOfReference.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
class TCollection_AsciiString;
class Storage_Data;
class CDM_Document;
class TCollection_ExtendedString;
class CDM_MessageDriver;
class PCDM_ReadWriter_1;
DEFINE_STANDARD_HANDLE(PCDM_ReadWriter_1, PCDM_ReadWriter)
class PCDM_ReadWriter_1 : public PCDM_ReadWriter
{
public:
Standard_EXPORT PCDM_ReadWriter_1();
//! returns PCDM_ReadWriter_1.
Standard_EXPORT TCollection_AsciiString Version() const;
Standard_EXPORT void WriteReferenceCounter (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument) const;
Standard_EXPORT void WriteReferences (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& theReferencerFileName) const;
Standard_EXPORT void WriteExtensions (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument) const;
Standard_EXPORT void WriteVersion (const Handle(Storage_Data)& aData, const Handle(CDM_Document)& aDocument) const;
Standard_EXPORT Standard_Integer ReadReferenceCounter (const TCollection_ExtendedString& aFileName, const Handle(CDM_MessageDriver)& theMsgDriver) const;
Standard_EXPORT void ReadReferences (const TCollection_ExtendedString& aFileName, PCDM_SequenceOfReference& theReferences, const Handle(CDM_MessageDriver)& theMsgDriver) const;
Standard_EXPORT void ReadExtensions (const TCollection_ExtendedString& aFileName, TColStd_SequenceOfExtendedString& theExtensions, const Handle(CDM_MessageDriver)& theMsgDriver) const;
Standard_EXPORT Standard_Integer ReadDocumentVersion (const TCollection_ExtendedString& aFileName, const Handle(CDM_MessageDriver)& theMsgDriver) const;
DEFINE_STANDARD_RTTI(PCDM_ReadWriter_1,PCDM_ReadWriter)
protected:
private:
Standard_EXPORT static void ReadUserInfo (const TCollection_ExtendedString& aFileName, const TCollection_AsciiString& Start, const TCollection_AsciiString& End, TColStd_SequenceOfExtendedString& theUserInfo, const Handle(CDM_MessageDriver)& theMsgDriver);
};
#endif // _PCDM_ReadWriter_1_HeaderFile

View File

@@ -1,49 +0,0 @@
-- Created on: 1997-12-18
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
deferred class Reader from PCDM inherits Transient from Standard
uses
Document from CDM,
ExtendedString from TCollection,
Application from CDM,
ReaderStatus from PCDM
raises DriverError from PCDM
is
CreateDocument(me: mutable) returns Document from CDM
is deferred;
---Purpose: this method is called by the framework before the read method.
Read(me: mutable; aFileName: ExtendedString from TCollection;
aNewDocument: Document from CDM;
anApplication: Application from CDM)
raises DriverError from PCDM
is deferred;
---Purpose: retrieves the content of the file into a new Document.
GetStatus(me) returns ReaderStatus from PCDM;
---C++: inline
fields
myReaderStatus : ReaderStatus from PCDM is protected;
end Reader from PCDM;

View File

@@ -14,5 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_Reader.ixx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <PCDM_DriverError.hxx>
#include <PCDM_Reader.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>

74
src/PCDM/PCDM_Reader.hxx Normal file
View File

@@ -0,0 +1,74 @@
// Created on: 1997-12-18
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_Reader_HeaderFile
#define _PCDM_Reader_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <PCDM_ReaderStatus.hxx>
#include <Standard_Transient.hxx>
class PCDM_DriverError;
class CDM_Document;
class TCollection_ExtendedString;
class CDM_Application;
class PCDM_Reader;
DEFINE_STANDARD_HANDLE(PCDM_Reader, Standard_Transient)
class PCDM_Reader : public Standard_Transient
{
public:
//! this method is called by the framework before the read method.
Standard_EXPORT virtual Handle(CDM_Document) CreateDocument() = 0;
//! retrieves the content of the file into a new Document.
Standard_EXPORT virtual void Read (const TCollection_ExtendedString& aFileName, const Handle(CDM_Document)& aNewDocument, const Handle(CDM_Application)& anApplication) = 0;
PCDM_ReaderStatus GetStatus() const;
DEFINE_STANDARD_RTTI(PCDM_Reader,Standard_Transient)
protected:
PCDM_ReaderStatus myReaderStatus;
private:
};
#include <PCDM_Reader.lxx>
#endif // _PCDM_Reader_HeaderFile

View File

@@ -0,0 +1,47 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_ReaderStatus_HeaderFile
#define _PCDM_ReaderStatus_HeaderFile
enum PCDM_ReaderStatus
{
PCDM_RS_OK,
PCDM_RS_NoDriver,
PCDM_RS_UnknownFileDriver,
PCDM_RS_OpenError,
PCDM_RS_NoVersion,
PCDM_RS_NoSchema,
PCDM_RS_NoDocument,
PCDM_RS_ExtensionFailure,
PCDM_RS_WrongStreamMode,
PCDM_RS_FormatFailure,
PCDM_RS_TypeFailure,
PCDM_RS_TypeNotFoundInSchema,
PCDM_RS_UnrecognizedFileFormat,
PCDM_RS_MakeFailure,
PCDM_RS_PermissionDenied,
PCDM_RS_DriverFailure,
PCDM_RS_AlreadyRetrievedAndModified,
PCDM_RS_AlreadyRetrieved,
PCDM_RS_UnknownDocument,
PCDM_RS_WrongResource,
PCDM_RS_ReaderException,
PCDM_RS_NoModel
};
#endif // _PCDM_ReaderStatus_HeaderFile

View File

@@ -1,36 +0,0 @@
-- Created on: 1997-12-09
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
private class Reference from PCDM
uses ExtendedString from TCollection
is
Create returns Reference from PCDM;
Create(aReferenceIdentifier: Integer from Standard; aFileName: ExtendedString from TCollection; aDocumentVersion: Integer from Standard)
returns Reference from PCDM;
ReferenceIdentifier(me) returns Integer from Standard;
FileName(me) returns ExtendedString from TCollection;
DocumentVersion(me) returns Integer from Standard;
fields
myReferenceIdentifier: Integer from Standard;
myFileName: ExtendedString from TCollection;
myDocumentVersion: Integer from Standard;
end Reference from PCDM;

View File

@@ -14,7 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_Reference.ixx>
#include <PCDM_Reference.hxx>
#include <TCollection_ExtendedString.hxx>
PCDM_Reference::PCDM_Reference(){}
PCDM_Reference::PCDM_Reference(const Standard_Integer aReferenceIdentifier, const TCollection_ExtendedString& aFileName, const Standard_Integer aDocumentVersion):myReferenceIdentifier(aReferenceIdentifier),myFileName(aFileName),myDocumentVersion(aDocumentVersion) {}

View File

@@ -0,0 +1,73 @@
// Created on: 1997-12-09
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_Reference_HeaderFile
#define _PCDM_Reference_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <TCollection_ExtendedString.hxx>
class TCollection_ExtendedString;
class PCDM_Reference
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT PCDM_Reference();
Standard_EXPORT PCDM_Reference(const Standard_Integer aReferenceIdentifier, const TCollection_ExtendedString& aFileName, const Standard_Integer aDocumentVersion);
Standard_EXPORT Standard_Integer ReferenceIdentifier() const;
Standard_EXPORT TCollection_ExtendedString FileName() const;
Standard_EXPORT Standard_Integer DocumentVersion() const;
protected:
private:
Standard_Integer myReferenceIdentifier;
TCollection_ExtendedString myFileName;
Standard_Integer myDocumentVersion;
};
#endif // _PCDM_Reference_HeaderFile

View File

@@ -1,58 +0,0 @@
-- Created on: 1997-12-01
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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 ReferenceIterator from PCDM inherits Transient from Standard
uses MetaData from CDM,
SequenceOfReference from PCDM,
Document from CDM, Application from CDM,
MessageDriver from CDM
is
Create (theMessageDriver : MessageDriver from CDM)
returns ReferenceIterator from PCDM;
---Purpose: Warning! The constructor does not initialization.
LoadReferences(me: mutable; aDocument: Document from CDM; aMetaData: MetaData from CDM; anApplication: Application from CDM; UseStorageConfiguration: Boolean from Standard);
Init(me: mutable;aMetaData: MetaData from CDM)
is virtual;
More(me) returns Boolean from Standard
is virtual private;
Next(me: mutable)
is virtual private;
MetaData(me;UseStorageConfiguration: Boolean from Standard )
returns MetaData from CDM
is virtual private;
ReferenceIdentifier(me) returns Integer from Standard
is virtual private;
DocumentVersion(me) returns Integer from Standard
---Purpose: returns the version of the document in the reference
is virtual private;
fields
myReferences: SequenceOfReference from PCDM;
myIterator: Integer from Standard;
myMessageDriver : MessageDriver from CDM;
end ReferenceIterator from PCDM;

View File

@@ -14,14 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_ReferenceIterator.ixx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <CDM_MessageDriver.hxx>
#include <CDM_MetaData.hxx>
#include <OSD_Path.hxx>
#include <PCDM_Reference.hxx>
#include <PCDM_ReferenceIterator.hxx>
#include <PCDM_RetrievalDriver.hxx>
#include <Standard_Type.hxx>
#include <Storage_Data.hxx>
#include <UTL.hxx>
#include <CDM_Document.hxx>
#include <CDM_Application.hxx>
#include <PCDM_RetrievalDriver.hxx>
#include <PCDM_Reference.hxx>
#include <OSD_Path.hxx>
#ifdef WNT
# include <tchar.h>

View File

@@ -0,0 +1,87 @@
// Created on: 1997-12-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_ReferenceIterator_HeaderFile
#define _PCDM_ReferenceIterator_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <PCDM_SequenceOfReference.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
class CDM_MessageDriver;
class CDM_Document;
class CDM_MetaData;
class CDM_Application;
class PCDM_ReferenceIterator;
DEFINE_STANDARD_HANDLE(PCDM_ReferenceIterator, Standard_Transient)
class PCDM_ReferenceIterator : public Standard_Transient
{
public:
//! Warning! The constructor does not initialization.
Standard_EXPORT PCDM_ReferenceIterator(const Handle(CDM_MessageDriver)& theMessageDriver);
Standard_EXPORT void LoadReferences (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData, const Handle(CDM_Application)& anApplication, const Standard_Boolean UseStorageConfiguration);
Standard_EXPORT virtual void Init (const Handle(CDM_MetaData)& aMetaData);
DEFINE_STANDARD_RTTI(PCDM_ReferenceIterator,Standard_Transient)
protected:
private:
Standard_EXPORT virtual Standard_Boolean More() const;
Standard_EXPORT virtual void Next();
Standard_EXPORT virtual Handle(CDM_MetaData) MetaData (const Standard_Boolean UseStorageConfiguration) const;
Standard_EXPORT virtual Standard_Integer ReferenceIdentifier() const;
//! returns the version of the document in the reference
Standard_EXPORT virtual Standard_Integer DocumentVersion() const;
PCDM_SequenceOfReference myReferences;
Standard_Integer myIterator;
Handle(CDM_MessageDriver) myMessageDriver;
};
#endif // _PCDM_ReferenceIterator_HeaderFile

View File

@@ -1,100 +0,0 @@
-- Created on: 1997-08-07
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
deferred class RetrievalDriver from PCDM
inherits Reader from PCDM
uses
Document from PCDM,
Document from CDM,
ExtendedString from TCollection,
SequenceOfExtendedString from TColStd,
AsciiString from TCollection,
SequenceOfReference from PCDM,
Schema from Storage,
MessageDriver from CDM,
Application from CDM
raises NoSuchObject from Standard, DriverError from PCDM
is
Read(me: mutable; aFileName: ExtendedString from TCollection;
aNewDocument: Document from CDM;
anApplication: Application from CDM)
raises DriverError from PCDM
---Purpose: Warning - raises DriverError if an error occurs during inside the
-- Make method.
is redefined virtual;
---Purpose: retrieves the content of the file into a new Document.
--
-- by default Read will use the Schema method to read the file
-- into a persistent document. and the Make method to build a
-- transient document.
--
Make(me : mutable; aPCDM: Document from PCDM; aNewDocument: Document from CDM)
raises DriverError from PCDM
is deferred;
SchemaName(me) returns ExtendedString from TCollection
is deferred;
LoadExtensions(me: mutable; aSchema: Schema from Storage; Extensions: SequenceOfExtendedString from TColStd; theMsgDriver: MessageDriver from CDM)
is virtual;
---Category: private methods.
References(myclass; aFileName: ExtendedString from TCollection; theReferences: out SequenceOfReference from PCDM; theMsgDriver: MessageDriver from CDM)
is private;
Extensions(myclass; aFileName: ExtendedString from TCollection; theExtensions: in out SequenceOfExtendedString from TColStd; theMsgDriver: MessageDriver from CDM)
is private;
UserInfo(myclass; aFileName: ExtendedString from TCollection; Start, End: AsciiString from TCollection; theUserInfo:in out SequenceOfExtendedString from TColStd; theMsgDriver: MessageDriver from CDM)
is private;
RaiseIfUnknownTypes(myclass; aSchema: Schema from Storage; aFileName: ExtendedString from TCollection);
DocumentVersion(myclass; aFileName: ExtendedString from TCollection; theMsgDriver: MessageDriver from CDM)
returns Integer from Standard;
ReferenceCounter(myclass; aFileName: ExtendedString from TCollection; theMsgDriver: MessageDriver from CDM)
returns Integer from Standard;
SetFormat (me : mutable; aformat : ExtendedString from TCollection);
GetFormat (me)
returns ExtendedString from TCollection;
--friends Init from class ReferenceIterator from PCDM(me: mutable;aMetaData: MetaData from CDM)
fields
myFormat : ExtendedString from TCollection;
friends
Init from class ReferenceIterator from PCDM(me: mutable;aMetaData: MetaData from CDM)
end RetrievalDriver from PCDM;

View File

@@ -14,26 +14,33 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_RetrievalDriver.ixx>
#include <PCDM_BaseDriverPointer.hxx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <CDM_MessageDriver.hxx>
#include <CDM_MetaData.hxx>
#include <PCDM.hxx>
#include <PCDM_TypeOfFileDriver.hxx>
#include <Storage_Data.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_Schema.hxx>
#include <Storage_Root.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <Standard_TypeMismatch.hxx>
#include <PCDM_BaseDriverPointer.hxx>
#include <PCDM_Document.hxx>
#include <PCDM_DriverError.hxx>
#include <PCDM_ReadWriter.hxx>
#include <PCDM_RetrievalDriver.hxx>
#include <PCDM_TypeOfFileDriver.hxx>
#include <Resource_Manager.hxx>
#include <Standard_ErrorHandler.hxx>
#include <PCDM.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <Standard_TypeMismatch.hxx>
#include <Storage_Data.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <locale.h>
#include <Storage_Root.hxx>
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <locale.h>
void PCDM_RetrievalDriver::RaiseIfUnknownTypes(const Handle(Storage_Schema)& aSchema, const TCollection_ExtendedString& aFileName) {
PCDM_BaseDriverPointer theFileDriver;

View File

@@ -0,0 +1,108 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_RetrievalDriver_HeaderFile
#define _PCDM_RetrievalDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCDM_Reader.hxx>
#include <PCDM_ReferenceIterator.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <PCDM_SequenceOfReference.hxx>
#include <Standard_Integer.hxx>
class Standard_NoSuchObject;
class PCDM_DriverError;
class CDM_MetaData;
class TCollection_ExtendedString;
class CDM_Document;
class CDM_Application;
class PCDM_Document;
class Storage_Schema;
class CDM_MessageDriver;
class TCollection_AsciiString;
class PCDM_RetrievalDriver;
DEFINE_STANDARD_HANDLE(PCDM_RetrievalDriver, PCDM_Reader)
class PCDM_RetrievalDriver : public PCDM_Reader
{
public:
//! Warning - raises DriverError if an error occurs during inside the
//! Make method.
//! retrieves the content of the file into a new Document.
//!
//! by default Read will use the Schema method to read the file
//! into a persistent document. and the Make method to build a
//! transient document.
Standard_EXPORT virtual void Read (const TCollection_ExtendedString& aFileName, const Handle(CDM_Document)& aNewDocument, const Handle(CDM_Application)& anApplication) Standard_OVERRIDE;
Standard_EXPORT virtual void Make (const Handle(PCDM_Document)& aPCDM, const Handle(CDM_Document)& aNewDocument) = 0;
Standard_EXPORT virtual TCollection_ExtendedString SchemaName() const = 0;
Standard_EXPORT virtual void LoadExtensions (const Handle(Storage_Schema)& aSchema, const TColStd_SequenceOfExtendedString& Extensions, const Handle(CDM_MessageDriver)& theMsgDriver);
Standard_EXPORT static void RaiseIfUnknownTypes (const Handle(Storage_Schema)& aSchema, const TCollection_ExtendedString& aFileName);
Standard_EXPORT static Standard_Integer DocumentVersion (const TCollection_ExtendedString& aFileName, const Handle(CDM_MessageDriver)& theMsgDriver);
Standard_EXPORT static Standard_Integer ReferenceCounter (const TCollection_ExtendedString& aFileName, const Handle(CDM_MessageDriver)& theMsgDriver);
Standard_EXPORT void SetFormat (const TCollection_ExtendedString& aformat);
Standard_EXPORT TCollection_ExtendedString GetFormat() const;
friend
Standard_EXPORT void PCDM_ReferenceIterator::Init (const Handle(CDM_MetaData)& aMetaData);
DEFINE_STANDARD_RTTI(PCDM_RetrievalDriver,PCDM_Reader)
protected:
private:
Standard_EXPORT static void References (const TCollection_ExtendedString& aFileName, PCDM_SequenceOfReference& theReferences, const Handle(CDM_MessageDriver)& theMsgDriver);
Standard_EXPORT static void Extensions (const TCollection_ExtendedString& aFileName, TColStd_SequenceOfExtendedString& theExtensions, const Handle(CDM_MessageDriver)& theMsgDriver);
Standard_EXPORT static void UserInfo (const TCollection_ExtendedString& aFileName, const TCollection_AsciiString& Start, const TCollection_AsciiString& End, TColStd_SequenceOfExtendedString& theUserInfo, const Handle(CDM_MessageDriver)& theMsgDriver);
TCollection_ExtendedString myFormat;
};
#endif // _PCDM_RetrievalDriver_HeaderFile

View File

@@ -1,96 +0,0 @@
-- Created on: 1997-11-03
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
deferred class StorageDriver from PCDM inherits Writer from PCDM
---Purpose: persistent implemention of storage.
--
-- The application must redefine one the two Make()
-- methods. The first one, if the application wants to
-- put only one document in the storage file.
--
-- The second method should be redefined to put
-- additional document that could be used by the
-- retrieval instead of the principal document, depending
-- on the schema used during the retrieval. For example,
-- a second document could be a standard
-- CDMShape_Document. This means that a client
-- application will already be able to extract a CDMShape_Document
-- of the file, if the Shape Schema remains unchanged.
--
---Category: persistent implemention of storage.
uses
Document from CDM,
Document from PCDM,
Data from Storage,
ExtendedString from TCollection,
Schema from Storage,
SequenceOfExtendedString from TColStd,
SequenceOfDocument from PCDM,
StoreStatus from PCDM
raises NoSuchObject from Standard,DriverError from PCDM
is
Make(me: mutable; aDocument: Document from CDM)
returns Document from PCDM
is virtual;
---Purpose: raises NotImplemented.
Make(me: mutable; aDocument: Document from CDM; Documents: out SequenceOfDocument from PCDM)
is virtual;
---Purpose:By default, puts in the Sequence the document returns
-- by the previous Make method.
--
--
SchemaName(me) returns ExtendedString from TCollection
is deferred;
LoadExtensions(me: mutable; aSchema: Schema from Storage; Extensions: SequenceOfExtendedString from TColStd)
is virtual;
Write(me: mutable; aDocument: Document from CDM; aFileName: ExtendedString from TCollection)
raises DriverError
---Purpose: Warning! raises DriverError if an error occurs during inside the
-- Make method.
is redefined virtual;
---Purpose: stores the content of the Document into a new file.
--
-- by default Write will use Make method to build a persistent
-- document and the Schema method to write the persistent document.
--
SetFormat (me : mutable; aformat : ExtendedString from TCollection);
GetFormat (me)
returns ExtendedString from TCollection;
IsError (me) returns Boolean from Standard;
SetIsError(me : mutable; theIsError : Boolean);
GetStoreStatus (me) returns StoreStatus from PCDM;
SetStoreStatus(me : mutable; theStoreStatus : StoreStatus from PCDM);
fields
myFormat : ExtendedString from TCollection;
myIsError: Boolean from Standard;
myStoreStatus: StoreStatus from PCDM;
end StorageDriver from PCDM;

View File

@@ -14,21 +14,28 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_StorageDriver.ixx>
#include <CDM_Document.hxx>
#include <FSD_CmpFile.hxx>
#include <PCDM.hxx>
#include <PCDM_Document.hxx>
#include <PCDM_DriverError.hxx>
#include <PCDM_ReadWriter.hxx>
#include <PCDM_SequenceOfDocument.hxx>
#include <PCDM_StorageDriver.hxx>
#include <Resource_Manager.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <Storage_Data.hxx>
#include <Storage_OpenMode.hxx>
#include <Storage_Schema.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <FSD_CmpFile.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_ErrorHandler.hxx>
#include <PCDM_ReadWriter.hxx>
#include <Resource_Manager.hxx>
#include <Standard_NotImplemented.hxx>
#include <PCDM_SequenceOfDocument.hxx>
#include <PCDM.hxx>
#include <locale.h>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <locale.h>
#define STORAGE_VERSION "STORAGE_VERSION:"

View File

@@ -0,0 +1,117 @@
// Created on: 1997-11-03
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_StorageDriver_HeaderFile
#define _PCDM_StorageDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_Boolean.hxx>
#include <PCDM_StoreStatus.hxx>
#include <PCDM_Writer.hxx>
#include <PCDM_SequenceOfDocument.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
class Standard_NoSuchObject;
class PCDM_DriverError;
class PCDM_Document;
class CDM_Document;
class TCollection_ExtendedString;
class Storage_Schema;
class PCDM_StorageDriver;
DEFINE_STANDARD_HANDLE(PCDM_StorageDriver, PCDM_Writer)
//! persistent implemention of storage.
//!
//! The application must redefine one the two Make()
//! methods. The first one, if the application wants to
//! put only one document in the storage file.
//!
//! The second method should be redefined to put
//! additional document that could be used by the
//! retrieval instead of the principal document, depending
//! on the schema used during the retrieval. For example,
//! a second document could be a standard
//! CDMShape_Document. This means that a client
//! application will already be able to extract a CDMShape_Document
//! of the file, if the Shape Schema remains unchanged.
class PCDM_StorageDriver : public PCDM_Writer
{
public:
//! raises NotImplemented.
Standard_EXPORT virtual Handle(PCDM_Document) Make (const Handle(CDM_Document)& aDocument);
//! By default, puts in the Sequence the document returns
//! by the previous Make method.
Standard_EXPORT virtual void Make (const Handle(CDM_Document)& aDocument, PCDM_SequenceOfDocument& Documents);
Standard_EXPORT virtual TCollection_ExtendedString SchemaName() const = 0;
Standard_EXPORT virtual void LoadExtensions (const Handle(Storage_Schema)& aSchema, const TColStd_SequenceOfExtendedString& Extensions);
//! Warning! raises DriverError if an error occurs during inside the
//! Make method.
//! stores the content of the Document into a new file.
//!
//! by default Write will use Make method to build a persistent
//! document and the Schema method to write the persistent document.
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName) Standard_OVERRIDE;
Standard_EXPORT void SetFormat (const TCollection_ExtendedString& aformat);
Standard_EXPORT TCollection_ExtendedString GetFormat() const;
Standard_EXPORT Standard_Boolean IsError() const;
Standard_EXPORT void SetIsError (const Standard_Boolean theIsError);
Standard_EXPORT PCDM_StoreStatus GetStoreStatus() const;
Standard_EXPORT void SetStoreStatus (const PCDM_StoreStatus theStoreStatus);
DEFINE_STANDARD_RTTI(PCDM_StorageDriver,PCDM_Writer)
protected:
private:
TCollection_ExtendedString myFormat;
Standard_Boolean myIsError;
PCDM_StoreStatus myStoreStatus;
};
#endif // _PCDM_StorageDriver_HeaderFile

View File

@@ -0,0 +1,32 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_StoreStatus_HeaderFile
#define _PCDM_StoreStatus_HeaderFile
enum PCDM_StoreStatus
{
PCDM_SS_OK,
PCDM_SS_DriverFailure,
PCDM_SS_WriteFailure,
PCDM_SS_Failure,
PCDM_SS_Doc_IsNull,
PCDM_SS_No_Obj,
PCDM_SS_Info_Section_Error
};
#endif // _PCDM_StoreStatus_HeaderFile

View File

@@ -0,0 +1,28 @@
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_TypeOfFileDriver_HeaderFile
#define _PCDM_TypeOfFileDriver_HeaderFile
enum PCDM_TypeOfFileDriver
{
PCDM_TOFD_File,
PCDM_TOFD_CmpFile,
PCDM_TOFD_Unknown
};
#endif // _PCDM_TypeOfFileDriver_HeaderFile

View File

@@ -1,28 +0,0 @@
-- Created on: 1997-12-18
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-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.
deferred class Writer from PCDM inherits Transient from Standard
uses Document from CDM, ExtendedString from TCollection
raises DriverError from PCDM
is
Write(me: mutable; aDocument: Document from CDM; aFileName: ExtendedString from TCollection)
raises DriverError
is deferred;
end Writer from PCDM;

View File

@@ -14,4 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PCDM_Writer.ixx>
#include <CDM_Document.hxx>
#include <PCDM_DriverError.hxx>
#include <PCDM_Writer.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>

64
src/PCDM/PCDM_Writer.hxx Normal file
View File

@@ -0,0 +1,64 @@
// Created on: 1997-12-18
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-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 _PCDM_Writer_HeaderFile
#define _PCDM_Writer_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
class PCDM_DriverError;
class CDM_Document;
class TCollection_ExtendedString;
class PCDM_Writer;
DEFINE_STANDARD_HANDLE(PCDM_Writer, Standard_Transient)
class PCDM_Writer : public Standard_Transient
{
public:
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName) = 0;
DEFINE_STANDARD_RTTI(PCDM_Writer,Standard_Transient)
protected:
private:
};
#endif // _PCDM_Writer_HeaderFile