b311480e |
1 | // Created on: 2001-07-09 |
2 | // Created by: Julia DOROVSKIKH |
3 | // Copyright (c) 2001-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 <XmlDrivers.ixx> |
22 | |
23 | #include <XmlDrivers_DocumentStorageDriver.hxx> |
24 | #include <XmlDrivers_DocumentRetrievalDriver.hxx> |
25 | #include <XmlMDF_ADriverTable.hxx> |
26 | #include <XmlMDF.hxx> |
27 | #include <XmlMDataStd.hxx> |
28 | #include <XmlMDataXtd.hxx> |
29 | #include <XmlMDocStd.hxx> |
30 | #include <XmlMNaming.hxx> |
31 | #include <XmlMPrsStd.hxx> |
32 | #include <XmlMFunction.hxx> |
33 | |
34 | #include <Standard_GUID.hxx> |
35 | |
36 | #include <locale.h> |
37 | #include <time.h> |
38 | |
39 | #include <Plugin_Macro.hxx> |
40 | |
7fd59977 |
41 | static Standard_GUID XmlStorageDriver ("03a56820-8269-11d5-aab2-0050044b1af1"); |
42 | static Standard_GUID XmlRetrievalDriver("03a56822-8269-11d5-aab2-0050044b1af1"); |
43 | |
44 | //======================================================================= |
45 | //function : Factory |
46 | //purpose : PLUGIN FACTORY |
47 | //======================================================================= |
48 | Handle(Standard_Transient) XmlDrivers::Factory(const Standard_GUID& theGUID) |
49 | { |
50 | if (theGUID == XmlStorageDriver) |
51 | { |
52 | cout << "XmlDrivers : Storage Plugin" << endl; |
53 | static Handle(XmlDrivers_DocumentStorageDriver) model_sd = |
54 | new XmlDrivers_DocumentStorageDriver |
55 | ("Copyright: Open Cascade, 2001-2002"); // default copyright |
56 | return model_sd; |
57 | } |
58 | |
59 | if (theGUID == XmlRetrievalDriver) |
60 | { |
61 | cout << "XmlDrivers : Retrieval Plugin" << endl; |
62 | static Handle (XmlDrivers_DocumentRetrievalDriver) model_rd = |
63 | new XmlDrivers_DocumentRetrievalDriver (); |
64 | return model_rd; |
65 | } |
66 | |
67 | Standard_Failure::Raise ("XmlDrivers : unknown GUID"); |
68 | return NULL; |
69 | } |
70 | |
71 | //======================================================================= |
72 | //function : AttributeDrivers |
73 | //purpose : |
74 | //======================================================================= |
75 | Handle(XmlMDF_ADriverTable) XmlDrivers::AttributeDrivers |
76 | (const Handle_CDM_MessageDriver& theMessageDriver) |
77 | { |
78 | Handle(XmlMDF_ADriverTable) aTable = new XmlMDF_ADriverTable(); |
79 | // |
80 | XmlMDF ::AddDrivers (aTable, theMessageDriver); |
81 | XmlMDataStd ::AddDrivers (aTable, theMessageDriver); |
82 | XmlMDataXtd ::AddDrivers (aTable, theMessageDriver); |
83 | XmlMNaming ::AddDrivers (aTable, theMessageDriver); |
84 | XmlMFunction ::AddDrivers (aTable, theMessageDriver); |
85 | XmlMDocStd ::AddDrivers (aTable, theMessageDriver); |
86 | XmlMPrsStd ::AddDrivers (aTable, theMessageDriver); |
87 | // |
88 | return aTable; |
89 | } |
90 | |
498ce76b |
91 | #ifdef _MSC_VER |
92 | #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */ |
93 | #endif |
94 | |
7fd59977 |
95 | // Declare entry point PLUGINFACTORY |
96 | PLUGIN(XmlDrivers) |