1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef __SALOMEDSIMPL_DRIVER_H__
23 #define __SALOMEDSIMPL_DRIVER_H__
25 #include "SALOMEDSImpl_Defines.hxx"
27 #include "SALOMEDSImpl_SComponent.hxx"
28 #include "SALOMEDSImpl_SObject.hxx"
29 #include "SALOMEDSImpl_TMPFile.hxx"
32 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver
36 virtual std::string GetIOR() = 0;
38 virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
39 const std::string& theURL,
40 long& theStreamLength,
41 bool isMultiFile) = 0;
43 virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
44 const std::string& theURL,
45 long& theStreamLength,
46 bool isMultiFile) = 0;
48 virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
49 const unsigned char* theStream,
50 const long theStreamLength,
51 const std::string& theURL,
52 bool isMultiFile) = 0;
54 virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
55 const unsigned char* theStream,
56 const long theStreamLength,
57 const std::string& theURL,
58 bool isMultiFile) = 0;
60 virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
62 virtual std::string ComponentDataType() = 0;
65 virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
66 const std::string& IORString,
70 virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
71 const std::string& aLocalPersistentID,
75 virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
77 virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
79 long& theStreamLength) = 0;
81 virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
83 virtual std::string PasteInto(const unsigned char* theStream,
84 const long theStreamLength,
86 const SALOMEDSImpl_SObject& theObject) = 0;
88 virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy,
91 long& theStreamLength) = 0;
94 class SALOMEDSImpl_DriverFactory
98 virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
100 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;