0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / BinDrivers / BinDrivers.cxx
CommitLineData
b311480e 1// Created on: 2002-10-29
2// Created by: Michael SAZONOV
3// Copyright (c) 2002-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20
21#include <BinDrivers.ixx>
22#include <BinLDrivers.hxx>
23#include <BinMDF.hxx>
24#include <BinMDataStd.hxx>
25#include <BinMDataXtd.hxx>
26#include <BinMNaming.hxx>
27#include <BinMDocStd.hxx>
28#include <BinMFunction.hxx>
29#include <BinMPrsStd.hxx>
30#include <Standard_Failure.hxx>
31#include <BinDrivers_DocumentStorageDriver.hxx>
32#include <BinDrivers_DocumentRetrievalDriver.hxx>
33#include <Plugin_Macro.hxx>
34
7fd59977 35static Standard_GUID BinStorageDriver ("03a56835-8269-11d5-aab2-0050044b1af1");
36static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1");
37
38//=======================================================================
39//function : Factory
40//purpose : PLUGIN FACTORY
41//=======================================================================
42Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
43{
44 if (theGUID == BinStorageDriver)
45 {
46 cout << "BinDrivers : Storage Plugin" << endl;
47 static Handle(BinDrivers_DocumentStorageDriver) model_sd =
48 new BinDrivers_DocumentStorageDriver;
49 return model_sd;
50 }
51
52 if (theGUID == BinRetrievalDriver)
53 {
54 cout << "BinDrivers : Retrieval Plugin" << endl;
55 static Handle(BinDrivers_DocumentRetrievalDriver) model_rd =
56 new BinDrivers_DocumentRetrievalDriver;
57 return model_rd;
58 }
59
60 Standard_Failure::Raise ("BinDrivers : unknown GUID");
61 return NULL;
62}
63
64//=======================================================================
65//function : AttributeDrivers
66//purpose :
67//=======================================================================
68
69Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers
70 (const Handle(CDM_MessageDriver)& aMsgDrv)
71{
72 Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable;
73
74 BinMDF ::AddDrivers (aTable, aMsgDrv);
75 BinMDataStd ::AddDrivers (aTable, aMsgDrv);
76 BinMDataXtd ::AddDrivers (aTable, aMsgDrv);
77 BinMNaming ::AddDrivers (aTable, aMsgDrv);
78 BinMDocStd ::AddDrivers (aTable, aMsgDrv);
79 BinMFunction ::AddDrivers (aTable, aMsgDrv);
80 BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
81 return aTable;
82}
83
84//=======================================================================
85//function : StorageVersion
86//purpose :
87//=======================================================================
88
89TCollection_AsciiString BinDrivers::StorageVersion()
90{
91 return BinLDrivers::StorageVersion();
92}
498ce76b 93
94#ifdef _MSC_VER
95#pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */
96#endif
7fd59977 97PLUGIN(BinDrivers)