719bdca43af3f2183feae835469619a92ba03348
[occt.git] / src / XmlXCAFDrivers / XmlXCAFDrivers.cxx
1 // Created on: 2001-09-11
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
17 #include <Plugin_Macro.hxx>
18 #include <Standard_Failure.hxx>
19 #include <Standard_GUID.hxx>
20 #include <Standard_Transient.hxx>
21 #include <XmlDrivers.hxx>
22 #include <XmlXCAFDrivers.hxx>
23 #include <XmlXCAFDrivers_DocumentRetrievalDriver.hxx>
24 #include <XmlXCAFDrivers_DocumentStorageDriver.hxx>
25
26 static Standard_GUID XSStorageDriver  ("f78ff496-a779-11d5-aab4-0050044b1af1");
27 static Standard_GUID XSRetrievalDriver("f78ff497-a779-11d5-aab4-0050044b1af1");
28
29 const Handle(Standard_Transient)& XmlXCAFDrivers::Factory(const Standard_GUID& aGUID)
30 {
31   if(aGUID == XSStorageDriver)  
32   {
33 #ifdef OCCT_DEBUG
34     cout << "XmlXCAFDrivers : Storage Plugin" << endl;
35 #endif
36     static Handle(XmlXCAFDrivers_DocumentStorageDriver) model_sd 
37       = new XmlXCAFDrivers_DocumentStorageDriver
38         ("Copyright: Open Cascade, 2001-2002"); // default copyright
39     return model_sd;
40   }
41   if(aGUID == XSRetrievalDriver) 
42   {  
43 #ifdef OCCT_DEBUG
44     cout << "XmlXCAFDrivers : Retrieval Plugin" << endl;
45 #endif
46     static Handle (XmlXCAFDrivers_DocumentRetrievalDriver) model_rd 
47       = new XmlXCAFDrivers_DocumentRetrievalDriver;
48     return model_rd;
49   }
50   
51   return XmlDrivers::Factory (aGUID);
52 }
53
54 PLUGIN(XmlXCAFDrivers)