Back to index

salome-kernel  6.5.0
SALOME_ModuleCatalog_Parser_IO.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
00024 //  File   : SALOME_ModuleCatalog_Parser_IO.cxx
00025 //  Author : Estelle Deville
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx,v 1.6.2.1.10.2.12.1 2012-04-12 14:05:17 vsr Exp $
00028 //
00029 #include "SALOME_ModuleCatalog_Parser_IO.hxx"
00030 #include <string>
00031 #include <iostream>
00032 #include "utilities.h"
00033 
00034 std::ostream & operator<< (std::ostream & f, const ParserParameter & P)
00035 {
00036   f << "          name :       " << P.name << std::endl;
00037   f << "          type :       " << P.type << std::endl;
00038   return f;
00039 }
00040 
00041 std::ostream & operator<< (std::ostream & f, 
00042                            const ParserDataStreamParameter & P)
00043 {
00044   f << "          name :       " << P.name << std::endl;
00045   f << "          type :       " << P.type << std::endl;
00046   f << "          dependency : " << P.dependency << std::endl;
00047   return f;
00048 }
00049 
00050 std::ostream & operator<< (std::ostream & f, 
00051                            const ParserService & S)
00052 {
00053   int i, n;
00054   f << "      name :       " << S.name << std::endl;
00055   f << "      default :    " << (S.byDefault ? "yes" : "no") 
00056     << std::endl;
00057 
00058   n = S.inParameters.size();
00059   f << "      in parameters : " << n << std::endl;
00060   for (i=0; i<n; i++)
00061     f << S.inParameters[i] << std::endl;
00062   if (n == 0) f << std::endl;
00063 
00064   n = S.inDataStreamParameters.size();
00065   f << "      in DataStream parameters : " << n << std::endl;
00066   for (i=0; i<n; i++)
00067     f << S.inDataStreamParameters[i] << std::endl;
00068   if (n == 0) f << std::endl;
00069 
00070   n = S.outParameters.size();
00071   f << "      out parameters : " << n << std::endl;
00072   for (i=0; i<n; i++)
00073     f << S.outParameters[i] << std::endl;
00074   if (n == 0) f << std::endl;
00075 
00076   n = S.outDataStreamParameters.size();
00077   f << "      out DataStream parameters : " << n << std::endl;
00078   for (i=0; i<n; i++)
00079     f << S.outDataStreamParameters[i] << std::endl;
00080   if (n == 0) f << std::endl;
00081 
00082   return f;
00083 }
00084 
00085 std::ostream & operator<< (std::ostream & f, 
00086                            const ParserInterface & I)
00087 {
00088   int j, n;
00089   f << "    name :       " << I.name << std::endl;
00090 
00091   n = I.services.size();
00092   f << "    services : " << n << std::endl;
00093   for (j=0; j<n; j++) {
00094     MESSAGE(I.services[j].name);
00095     f << I.services[j] << std::endl;
00096   }
00097 
00098   return f;
00099 }
00100 
00101 std::ostream & operator<< (std::ostream & f, 
00102                            const  ParserComponentType & T)
00103 {
00104   std::string s;
00105   switch (T) {
00106   case GEOM :   s = "GEOM"; break;
00107   case MESH :   s = "MESH"; break;
00108   case Med  :   s = "Med"; break;
00109   case SOLVER : s = "SOLVER"; break;
00110   case DATA :   s = "DATA"; break;
00111   case VISU :   s = "VISU"; break;
00112   case SUPERV : s = "SUPERV"; break;
00113   default :     s = "OTHER"; break;
00114   }
00115   f << s << std::endl;
00116   return f;
00117 }
00118 
00119 std::ostream & operator<< (std::ostream & f, 
00120                            const ParserComponent & C)
00121 {
00122   int j, n;
00123   f << std::endl
00124     << "    name :       " << C.name << std::endl;
00125   f << "    user name :  " << C.username << std::endl;
00126   f << "    type :       " << C.type << std::endl;
00127   f << "    multistudy : " << (C.multistudy ? "yes" : "no")
00128     << std::endl;
00129   f << "    icon :       " << C.icon << std::endl;
00130   f << "    constraint : " << C.constraint << std::endl;
00131 
00132   n = C.interfaces.size();
00133   f << "    interfaces : " << n << std::endl;
00134   for (j=0; j<n; j++)
00135     f << C.interfaces[j] << std::endl;
00136   if (n == 0) f << std::endl;
00137 
00138   return f;
00139 }
00140 
00141