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