From 27d3793c807404c379e84423bfb550d30477a65c Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Fri, 31 Oct 2003 17:42:40 +0000 Subject: [PATCH] [ 829319 ] XML module tweaks git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5215 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/xml.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/Modules/xml.cxx b/Source/Modules/xml.cxx index 1318e88c2..2832e1a1f 100644 --- a/Source/Modules/xml.cxx +++ b/Source/Modules/xml.cxx @@ -14,6 +14,7 @@ char cvsroot_xml_cxx[] = "$Header$"; static const char *usage = "\ XML Options (available with -xml)\n\ -xmllang - Typedef language\n\ + -xmllite - More lightweight version of XML\n\ ------\n\ deprecated (use -o): -xml - Use as output file (extension .xml mandatory)\n"; @@ -22,6 +23,8 @@ XML Options (available with -xml)\n\ //static Node *view_top = 0; static File *out = 0; +static int xmllite = 0; + class XML : public Language @@ -79,6 +82,11 @@ public: { fputs( usage, stderr ); } + if( strcmp( argv[iX], "-xmllite" ) == 0 ) + { + Swig_mark_arg (iX); + xmllite = 1; + } } // Add a symbol to the parser for conditional compilation @@ -93,6 +101,7 @@ public: { String *outfile = Getattr(n,"outfile"); Replaceall(outfile,".cxx", ".xml"); + Replaceall(outfile,".cpp", ".xml"); Replaceall(outfile,".c", ".xml"); out = NewFile(outfile,"w"); if (!out) @@ -159,11 +168,11 @@ public: { Xml_print_baselist( Getattr(obj,k) ); } - else if (Cmp(k,"typescope") == 0) + else if (!xmllite && Cmp(k,"typescope") == 0) { Xml_print_typescope( Getattr(obj,k) ); } - else if (Cmp(k,"typetab") == 0) + else if (!xmllite && Cmp(k,"typetab") == 0) { Xml_print_typetab( Getattr(obj,k) ); }