Salome HOME
IMP NPAL13547: Checkbox to kill SALOME completely.
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Parser_IO.cxx
1
2 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
3 //
4 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
6 // 
7 //  This library is free software; you can redistribute it and/or 
8 //  modify it under the terms of the GNU Lesser General Public 
9 //  License as published by the Free Software Foundation; either 
10 //  version 2.1 of the License. 
11 // 
12 //  This library is distributed in the hope that it will be useful, 
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
15 //  Lesser General Public License for more details. 
16 // 
17 //  You should have received a copy of the GNU Lesser General Public 
18 //  License along with this library; if not, write to the Free Software 
19 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
20 // 
21 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 //
23 //
24 //
25 //  File   : SALOME_ModuleCatalog_Parser_IO.cxx
26 //  Author : Estelle Deville
27 //  Module : SALOME
28 //  $Header$
29
30 #include "SALOME_ModuleCatalog_Parser_IO.hxx"
31 #include <string>
32 #include <iostream>
33 #include "utilities.h"
34
35 using namespace std;
36
37 std::ostream & operator<< (std::ostream & f, const ParserParameter & P)
38 {
39   f << "          name :       " << P.name << std::endl;
40   f << "          type :       " << P.type << std::endl;
41   return f;
42 }
43
44 std::ostream & operator<< (std::ostream & f, 
45                            const ParserDataStreamParameter & P)
46 {
47   f << "          name :       " << P.name << std::endl;
48   f << "          type :       " << P.type << std::endl;
49   f << "          dependency : " << P.dependency << std::endl;
50   return f;
51 }
52
53 std::ostream & operator<< (std::ostream & f, 
54                            const ParserService & S)
55 {
56   int i, n;
57   f << "      name :       " << S.name << std::endl;
58   f << "      default :    " << (S.byDefault ? "yes" : "no") 
59     << std::endl;
60
61   n = S.inParameters.size();
62   f << "      in parameters : " << n << std::endl;
63   for (i=0; i<n; i++)
64     f << S.inParameters[i] << std::endl;
65   if (n == 0) f << std::endl;
66
67   n = S.inDataStreamParameters.size();
68   f << "      in DataStream parameters : " << n << std::endl;
69   for (i=0; i<n; i++)
70     f << S.inDataStreamParameters[i] << std::endl;
71   if (n == 0) f << std::endl;
72
73   n = S.outParameters.size();
74   f << "      out parameters : " << n << std::endl;
75   for (i=0; i<n; i++)
76     f << S.outParameters[i] << std::endl;
77   if (n == 0) f << std::endl;
78
79   n = S.outDataStreamParameters.size();
80   f << "      out DataStream parameters : " << n << std::endl;
81   for (i=0; i<n; i++)
82     f << S.outDataStreamParameters[i] << std::endl;
83   if (n == 0) f << std::endl;
84
85   return f;
86 }
87
88 std::ostream & operator<< (std::ostream & f, 
89                            const ParserInterface & I)
90 {
91   int j, n;
92   f << "    name :       " << I.name << std::endl;
93
94   n = I.services.size();
95   f << "    services : " << n << std::endl;
96   for (j=0; j<n; j++) {
97     MESSAGE(I.services[j].name);
98     f << I.services[j] << std::endl;
99   }
100
101   return f;
102 }
103
104 std::ostream & operator<< (std::ostream & f, 
105                            const  ParserComponentType & T)
106 {
107   std::string s;
108   switch (T) {
109   case GEOM :   s = "GEOM"; break;
110   case MESH :   s = "MESH"; break;
111   case Med  :   s = "Med"; break;
112   case SOLVER : s = "SOLVER"; break;
113   case DATA :   s = "DATA"; break;
114   case VISU :   s = "VISU"; break;
115   case SUPERV : s = "SUPERV"; break;
116   default :     s = "OTHER"; break;
117   }
118   f << s << std::endl;
119   return f;
120 }
121
122 std::ostream & operator<< (std::ostream & f, 
123                            const ParserComponent & C)
124 {
125   int j, n;
126   f << std::endl
127     << "    name :       " << C.name << std::endl;
128   f << "    user name :  " << C.username << std::endl;
129   f << "    type :       " << C.type << std::endl;
130   f << "    multistudy : " << (C.multistudy ? "yes" : "no")
131     << std::endl;
132   f << "    icon :       " << C.icon << std::endl;
133   f << "    constraint : " << C.constraint << std::endl;
134
135   n = C.interfaces.size();
136   f << "    interfaces : " << n << std::endl;
137   for (j=0; j<n; j++)
138     f << C.interfaces[j] << std::endl;
139   if (n == 0) f << std::endl;
140
141   return f;
142 }
143
144