1 // Copyright (C) 2007-2012 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
23 #ifndef __SALOMEDSIMPL_DRIVER_H__
24 #define __SALOMEDSIMPL_DRIVER_H__
26 #include "SALOMEDSImpl_Defines.hxx"
28 #include "SALOMEDSImpl_SComponent.hxx"
29 #include "SALOMEDSImpl_SObject.hxx"
30 #include "SALOMEDSImpl_TMPFile.hxx"
33 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver
37 virtual std::string GetIOR() = 0;
39 virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
40 const std::string& theURL,
41 long& theStreamLength,
42 bool isMultiFile) = 0;
44 virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
45 const std::string& theURL,
46 long& theStreamLength,
47 bool isMultiFile) = 0;
49 virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
50 const unsigned char* theStream,
51 const long theStreamLength,
52 const std::string& theURL,
53 bool isMultiFile) = 0;
55 virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
56 const unsigned char* theStream,
57 const long theStreamLength,
58 const std::string& theURL,
59 bool isMultiFile) = 0;
61 virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
63 virtual std::string ComponentDataType() = 0;
66 virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
67 const std::string& IORString,
71 virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
72 const std::string& aLocalPersistentID,
76 virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
78 virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
80 long& theStreamLength) = 0;
82 virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
84 virtual std::string PasteInto(const unsigned char* theStream,
85 const long theStreamLength,
87 const SALOMEDSImpl_SObject& theObject) = 0;
89 virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy,
93 long& theStreamLength) = 0;
96 class SALOMEDSImpl_DriverFactory
100 virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
102 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;