3 # Script to generate builder_data.hpp, with the definitions given in
5 # Each line of the definition file is in the following format:
6 # ClassName param1:type1 param2:type2 ...
10 deffile = open("builder_data.def")
11 hppfile = open("builder_data.hpp","w")
14 """/*****************************************************************************
16 *****************************************************************************
17 * Copyright (C) 2003 the VideoLAN team
20 * Authors: Cyril Deguet <asmax@via.ecp.fr>
21 * Olivier Teulière <ipkiss@via.ecp.fr>
23 * This program is free software; you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation; either version 2 of the License, or
26 * (at your option) any later version.
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
36 *****************************************************************************/
38 //File generated by gen_builder.py
39 //DO NOT EDIT BY HAND !
41 #ifndef BUILDER_DATA_HPP
42 #define BUILDER_DATA_HPP
51 /// Structure for mapping data from XML file
58 line = string.strip(deffile.readline())
61 items = string.split(line, ' ')
63 str = " /// Type definition\n"
64 str += " struct " + name + "\n {\n"
65 str += " " + name + "( "
70 vardef = string.split(var, ':');
73 if vartype == "string":
74 vartype = "const string &"
77 constructor += vartype + " " + varname
80 initlist += "m_" + varname + "( " + varname + " )"
82 if vartype == "string":
83 vartype = "const string"
84 vars += " " + vartype + " m_" + varname + ";\n"
85 str += constructor + " ):\n" + initlist + " {}\n\n"
88 str += " list<" + name + "> m_list" + name + ";\n"