# Copyright (C) 2006-2016 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # This awk program generates the catalog for C++ components # BEGIN { # # file name generation catalog_file="catalog.xml" print "\n" > catalog_file print "\n"\ "\n"\ " " >> catalog_file print " \n"\ " "class_name"\n"\ " "class_name"\n"\ " Solver\n"\ " ""\n"\ " 1.0\n"\ " \n"\ " "class_name".png\n"\ " 1\n"\ " " >> catalog_file print " "class_name"\n"\ " No comment\n"\ " "\ "\n" >> catalog_file type_in = 1 type_out = 2 type_arg["int"]= type_in type_arg["double"]= type_in type_arg["float"]= type_in type_arg["long"]= type_in type_arg["short"]= type_in type_arg["unsigned"]= type_in type_arg["const char*"]= type_in type_arg["const std::string&"]= type_in type_arg["const std::vector&"]= type_in type_arg["int&"]= type_out type_arg["double&"]= type_out type_arg["float&"]= type_out type_arg["long&"]= type_out type_arg["short&"]= type_out type_arg["unsigned&"]= type_out type_arg["std::string&"]= type_out type_arg["std::vector&"]= type_out # # # record sep is ");\n" whith blanks all around, and optional "(" at the beginning RS="[(]?[ ]*[)][ ]*;[ ]*\n?" FS="[ ]*[(,][ ]*" # field sep is either "(" or "," surrounded by blanks } # --------------------- treatment 1 ---------------------------------- # # extract from fields types, function name, and argument's names # { nitems = split($0, items); for (i=1; i<=nitems; i++) { split(items[i], j, " "); l=0; for (k in j) {l++;} k=j[1]; for (ll=2; ll\n"\ " "name[1]"\n"\ " \n"\ " \n"\ " \n"\ " 0\n"\ >> catalog_file print " " >> catalog_file for (i=2; i<=nitems; i++) if (way[i] == type_in) { print " \n"\ " "name[i]"\n"\ " "type[i]"\n"\ " \n"\ " " >> catalog_file } print " \n" >> catalog_file print " " >> catalog_file if (type[1] != "void") print " \n"\ " return\n"\ " "type[1]"\n"\ " \n"\ " " >> catalog_file for (i=2; i<=nitems; i++) if (way[i] == type_out) { print " \n"\ " "name[i]"\n"\ " "type[i]"\n"\ " \n"\ " " >> catalog_file } print " \n" >> catalog_file print " \n" >> catalog_file } # END { print " \n"\ " \n"\ " \n"\ " \n"\ "" >> catalog_file }