comparison dbus-d/dsrc/org/freedesktop/dbus/tool/CreateInterface.d @ 12:198c379caaa7 default tip

remove explicit tango import path
author Frank Benoit <benoit@tionex.de>
date Sun, 18 Nov 2007 18:16:28 +0100
parents 963d271f7c25
children
comparison
equal deleted inserted replaced
11:44c987465a20 12:198c379caaa7
1 /* 1 /*
2 * Copyright (C) 2007 Frank Benoit 2 * Copyright (C) 2007 Frank Benoit
3 * 3 *
4 * Licensed under the Academic Free License version 2.1 4 * Licensed under the Academic Free License version 2.1
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 */ 20 */
418 // SIGNATURE 103 (ASCII 'g') A type signature 418 // SIGNATURE 103 (ASCII 'g') A type signature
419 // ARRAY 97 (ASCII 'a') Array 419 // ARRAY 97 (ASCII 'a') Array
420 // STRUCT 114 (ASCII 'r'), 40 (ASCII '('), 41 (ASCII ')') Struct 420 // STRUCT 114 (ASCII 'r'), 40 (ASCII '('), 41 (ASCII ')') Struct
421 // VARIANT 118 (ASCII 'v') Variant type (the type of the value is part of the value itself) 421 // VARIANT 118 (ASCII 'v') Variant type (the type of the value is part of the value itself)
422 // DICT_ENTRY 101 (ASCII 'e'), 123 (ASCII '{'), 125 (ASCII '}') Entry in a dict or map (array of key-value pairs) 422 // DICT_ENTRY 101 (ASCII 'e'), 123 (ASCII '{'), 125 (ASCII '}') Entry in a dict or map (array of key-value pairs)
423 // 423 //
424 424
425 425
426 void parseNode( Element el ){ 426 void parseNode( Element el ){
427 427
428 el.checkAllowedChilds( ID_INTF, ID_NODE ); 428 el.checkAllowedChilds( ID_INTF, ID_NODE );
431 auto defIntf = parseInterface( intf ); 431 auto defIntf = parseInterface( intf );
432 intfTree.add( defIntf ); 432 intfTree.add( defIntf );
433 } 433 }
434 foreach( node; el.getChilds( ID_NODE )){ 434 foreach( node; el.getChilds( ID_NODE )){
435 parseNode( node ); 435 parseNode( node );
436 } 436 }
437 } 437 }
438 438
439 void unknownElement( char[][] msg ... ){ 439 void unknownElement( char[][] msg ... ){
440 char[200] buf; 440 char[200] buf;
441 Stderr( layout( buf, msg ) ).newline; 441 Stderr( layout( buf, msg ) ).newline;
807 p.formatln( "}" ); 807 p.formatln( "}" );
808 p.newline; 808 p.newline;
809 p.newline; 809 p.newline;
810 } 810 }
811 class TextList { 811 class TextList {
812 812
813 private char[] separator; 813 private char[] separator;
814 private char[] sb; 814 private char[] sb;
815 private char[] prefix; 815 private char[] prefix;
816 private char[] postfix; 816 private char[] postfix;
817 private bool completed = false; 817 private bool completed = false;
824 public this( char[] prefix, char[] separator, char[] postfix ){ 824 public this( char[] prefix, char[] separator, char[] postfix ){
825 this.prefix = prefix; 825 this.prefix = prefix;
826 this.separator = separator; 826 this.separator = separator;
827 this.postfix = postfix; 827 this.postfix = postfix;
828 } 828 }
829 829
830 public static TextList createParameterList(){ 830 public static TextList createParameterList(){
831 return new TextList( " ", ", ", " " ); 831 return new TextList( " ", ", ", " " );
832 } 832 }
833 833
834 public void add( char[] value ){ 834 public void add( char[] value ){