0025266: Debug statements in the source are getting flushed on to the console
[occt.git] / src / XmlDrivers / XmlDrivers.cxx
1 // Created on: 2001-07-09
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <XmlDrivers.ixx>
17
18 #include <XmlDrivers_DocumentStorageDriver.hxx>
19 #include <XmlDrivers_DocumentRetrievalDriver.hxx>
20 #include <XmlMDF_ADriverTable.hxx>
21 #include <XmlMDF.hxx>
22 #include <XmlMDataStd.hxx>
23 #include <XmlMDataXtd.hxx>
24 #include <XmlMDocStd.hxx>
25 #include <XmlMNaming.hxx>
26 #include <XmlMPrsStd.hxx>
27 #include <XmlMFunction.hxx>
28
29 #include <Standard_GUID.hxx>
30
31 #include <locale.h>
32 #include <time.h>
33
34 #include <Plugin_Macro.hxx>
35
36 static Standard_GUID XmlStorageDriver  ("03a56820-8269-11d5-aab2-0050044b1af1");
37 static Standard_GUID XmlRetrievalDriver("03a56822-8269-11d5-aab2-0050044b1af1");
38
39 //=======================================================================
40 //function : Factory
41 //purpose  : PLUGIN FACTORY
42 //=======================================================================
43 Handle(Standard_Transient) XmlDrivers::Factory(const Standard_GUID& theGUID)
44 {
45   if (theGUID == XmlStorageDriver)
46   {
47 #ifdef XMLDRIVERS_DEB
48     cout << "XmlDrivers : Storage Plugin" << endl;
49 #endif
50     static Handle(XmlDrivers_DocumentStorageDriver) model_sd =
51       new XmlDrivers_DocumentStorageDriver
52         ("Copyright: Open Cascade, 2001-2002"); // default copyright
53     return model_sd;
54   }
55
56   if (theGUID == XmlRetrievalDriver)
57   {
58 #ifdef XMLDRIVERS_DEB
59     cout << "XmlDrivers : Retrieval Plugin" << endl;
60 #endif
61     static Handle (XmlDrivers_DocumentRetrievalDriver) model_rd =
62       new XmlDrivers_DocumentRetrievalDriver ();
63     return model_rd;
64   }
65  
66   Standard_Failure::Raise ("XmlDrivers : unknown GUID");
67   return NULL;
68 }
69
70 //=======================================================================
71 //function : AttributeDrivers
72 //purpose  : 
73 //=======================================================================
74 Handle(XmlMDF_ADriverTable) XmlDrivers::AttributeDrivers
75                 (const Handle(CDM_MessageDriver)& theMessageDriver)
76 {
77   Handle(XmlMDF_ADriverTable) aTable = new XmlMDF_ADriverTable();
78   //
79   XmlMDF        ::AddDrivers (aTable, theMessageDriver);
80   XmlMDataStd   ::AddDrivers (aTable, theMessageDriver);
81   XmlMDataXtd   ::AddDrivers (aTable, theMessageDriver);  
82   XmlMNaming    ::AddDrivers (aTable, theMessageDriver);
83   XmlMFunction  ::AddDrivers (aTable, theMessageDriver); 
84   XmlMDocStd    ::AddDrivers (aTable, theMessageDriver); 
85   XmlMPrsStd    ::AddDrivers (aTable, theMessageDriver); 
86   //
87   return aTable;
88 }
89
90 #ifdef _MSC_VER
91 #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */
92 #endif
93
94 // Declare entry point PLUGINFACTORY
95 PLUGIN(XmlDrivers)