From e986e0039de21791bd1fbb1f59b13f58c4a46324 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 15 Nov 2014 16:25:51 +0100 Subject: Added language attribute to XML output for classes, namespaces, and files --- src/libdoxygen.t.in | 2 +- src/res2cc_cmd.py | 18 +++++++++++++++++- src/xmlgen.cpp | 13 ++++++++----- templates/xml/compound.xsd | 21 +++++++++++++++++++++ testing/008/008__brief_8c.xml | 2 +- testing/009/class_bug.xml | 2 +- testing/009/class_deprecated.xml | 2 +- testing/009/class_reminder.xml | 2 +- testing/009/class_test.xml | 2 +- testing/009/class_todo.xml | 2 +- testing/011/category_integer_07_arithmetic_08.xml | 2 +- testing/011/interface_integer.xml | 2 +- testing/013/class_t1.xml | 2 +- testing/013/class_t2.xml | 2 +- testing/013/class_t3.xml | 2 +- testing/013/class_t4.xml | 2 +- testing/015/015__cond_8c.xml | 2 +- testing/016/016__copydoc_8c.xml | 2 +- testing/018/018__def_8c.xml | 2 +- testing/025/class_test.xml | 2 +- testing/026/class_test.xml | 2 +- testing/027/struct_car.xml | 2 +- testing/027/struct_object.xml | 2 +- testing/027/struct_truck.xml | 2 +- testing/027/struct_vehicle.xml | 2 +- testing/029/029__hideinit_8c.xml | 2 +- testing/035/035__invariant_8c.xml | 2 +- testing/036/036__link_8c.xml | 2 +- testing/037/class_receiver.xml | 2 +- testing/037/class_sender.xml | 2 +- testing/039/class_test.xml | 2 +- testing/040/namespace_n_s.xml | 2 +- testing/041/class_test.xml | 2 +- testing/042/namespaceorg_1_1doxygen_1_1_test.xml | 2 +- testing/044/struct_s.xml | 2 +- testing/046/046__related_8cpp.xml | 2 +- testing/046/class_test.xml | 2 +- testing/047/047__return_8cpp.xml | 2 +- testing/048/048__showinit_8c.xml | 2 +- testing/054/054__parblock_8cpp.xml | 2 +- testing/057/057__caller__graphs_8tcl.xml | 2 +- testing/057/__057__caller__graphs_8tcl.xml | 2 +- testing/057/namespace1.xml | 2 +- testing/057/namespace1_1_11.xml | 2 +- testing/057/namespace1_1_11_1_11.xml | 2 +- testing/057/namespace2.xml | 2 +- testing/057/namespace2_1_12.xml | 2 +- testing/057/namespace2_1_12_1_12.xml | 2 +- testing/057/namespace2_1_12_1_12_1_12.xml | 2 +- testing/057/namespace2_1_12_1_12_1_12_1_12.xml | 2 +- testing/057/namespacebar.xml | 2 +- testing/057/namespacefoo.xml | 2 +- testing/058/058__bracket__recursion_8tcl.xml | 2 +- testing/059/059__command__catch_8tcl.xml | 2 +- testing/060/060__command__switch_8tcl.xml | 2 +- testing/061/class_test.xml | 2 +- testing/062/namespacen1.xml | 2 +- testing/062/namespacen2.xml | 2 +- testing/062/namespacen3.xml | 2 +- testing/063/namespaceoo.xml | 2 +- testing/063/namespaceoo_1_1_helpers.xml | 2 +- testing/063/namespaceoo_1_1define.xml | 2 +- 62 files changed, 105 insertions(+), 65 deletions(-) diff --git a/src/libdoxygen.t.in b/src/libdoxygen.t.in index 58563d1..1d242d0 100644 --- a/src/libdoxygen.t.in +++ b/src/libdoxygen.t.in @@ -121,6 +121,6 @@ TO_C_CMD=$(PYTHON) to_c_cmd.py < $< > $@ $(GENERATED_SRC)/layout_default.xml.h: layout_default.xml $(TO_C_CMD) -../generated_src/doxygen/resources.cpp: res2cc_cmd.py $(wildcard ../templates/html/*) +../generated_src/doxygen/resources.cpp: res2cc_cmd.py $(wildcard ../templates/html/*) $(wildcard ../templates/xml) $(wildcard ../templates/latex) $(PYTHON) res2cc_cmd.py ../templates ../generated_src/doxygen/resources.cpp diff --git a/src/res2cc_cmd.py b/src/res2cc_cmd.py index 40d2906..772ac84 100755 --- a/src/res2cc_cmd.py +++ b/src/res2cc_cmd.py @@ -1,3 +1,19 @@ +#!/usr/bin/python +# Script that compiles a set of resources into a single C++ source file. The C++ file +# offers an initResources() function, which registers the resources with the resource +# manager (class ResourceMgr) +# +# Copyright (C) 1997-2014 by Dimitri van Heesch. +# +# Permission to use, copy, modify, and distribute this software and its +# documentation under the terms of the GNU General Public License is hereby +# granted. No representations are made about the suitability of this software +# for any purpose. It is provided "as is" without express or implied warranty. +# See the GNU General Public License for more details. +# +# Documents produced by Doxygen are derivative works derived from the +# input used in their production; they are not affected by this license. +# from __future__ import print_function from os import listdir, stat, walk from os.path import isfile, join, splitext @@ -78,7 +94,7 @@ class LumaFile(File): def main(): if len(sys.argv)<3: - sys.exit('Usage: %s directory output_file.c' % sys.argv[0]) + sys.exit('Usage: %s directory output_file.cpp' % sys.argv[0]) directory = sys.argv[1] files = [] for dirName, subdirList, fileList in walk(directory): diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 01d7f9d..28da1eb 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1251,7 +1251,8 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) writeXMLHeader(t); t << " compoundTypeString() << "\" prot=\""; + << cd->compoundTypeString() << "\" language=\"" + << langToString(cd->getLanguage()) << "\" prot=\""; switch (cd->protection()) { case Public: t << "public"; break; @@ -1448,8 +1449,9 @@ static void generateXMLForNamespace(NamespaceDef *nd,FTextStream &ti) //t.setEncoding(FTextStream::UnicodeUTF8); writeXMLHeader(t); - t << " getOutputFileBase() << "\" kind=\"namespace\">" << endl; + t << " getOutputFileBase() + << "\" kind=\"namespace\" language=\"" + << langToString(nd->getLanguage()) << "\">" << endl; t << " "; writeXMLString(t,nd->name()); t << "" << endl; @@ -1528,8 +1530,9 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti) //t.setEncoding(FTextStream::UnicodeUTF8); writeXMLHeader(t); - t << " getOutputFileBase() << "\" kind=\"file\">" << endl; + t << " getOutputFileBase() + << "\" kind=\"file\" language=\"" + << langToString(fd->getLanguage()) << "\">" << endl; t << " "; writeXMLString(t,fd->name()); t << "" << endl; diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index be897c3..50e532e 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -39,6 +39,7 @@ + @@ -686,6 +687,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/testing/008/008__brief_8c.xml b/testing/008/008__brief_8c.xml index 3416798..4fcf6a6 100644 --- a/testing/008/008__brief_8c.xml +++ b/testing/008/008__brief_8c.xml @@ -1,6 +1,6 @@ - + 008_brief.c A brief description. diff --git a/testing/009/class_bug.xml b/testing/009/class_bug.xml index 75a3fa1..dc1ff06 100644 --- a/testing/009/class_bug.xml +++ b/testing/009/class_bug.xml @@ -1,6 +1,6 @@ - + Bug diff --git a/testing/009/class_deprecated.xml b/testing/009/class_deprecated.xml index 2420466..53a6273 100644 --- a/testing/009/class_deprecated.xml +++ b/testing/009/class_deprecated.xml @@ -1,6 +1,6 @@ - + Deprecated diff --git a/testing/009/class_reminder.xml b/testing/009/class_reminder.xml index 2f3c641..c4f639e 100644 --- a/testing/009/class_reminder.xml +++ b/testing/009/class_reminder.xml @@ -1,6 +1,6 @@ - + Reminder diff --git a/testing/009/class_test.xml b/testing/009/class_test.xml index 505617f..b9f7f9f 100644 --- a/testing/009/class_test.xml +++ b/testing/009/class_test.xml @@ -1,6 +1,6 @@ - + Test diff --git a/testing/009/class_todo.xml b/testing/009/class_todo.xml index 0ac555f..c98fdac 100644 --- a/testing/009/class_todo.xml +++ b/testing/009/class_todo.xml @@ -1,6 +1,6 @@ - + Todo diff --git a/testing/011/category_integer_07_arithmetic_08.xml b/testing/011/category_integer_07_arithmetic_08.xml index 9d64d98..73308db 100644 --- a/testing/011/category_integer_07_arithmetic_08.xml +++ b/testing/011/category_integer_07_arithmetic_08.xml @@ -1,6 +1,6 @@ - + Integer(Arithmetic) diff --git a/testing/011/interface_integer.xml b/testing/011/interface_integer.xml index bdbcad2..e922dda 100644 --- a/testing/011/interface_integer.xml +++ b/testing/011/interface_integer.xml @@ -1,6 +1,6 @@ - + Integer Object diff --git a/testing/013/class_t1.xml b/testing/013/class_t1.xml index 2a9b415..e0dc3a2 100644 --- a/testing/013/class_t1.xml +++ b/testing/013/class_t1.xml @@ -1,6 +1,6 @@ - + T1 inc/013_class.h diff --git a/testing/013/class_t2.xml b/testing/013/class_t2.xml index 9c85ff6..ca534e6 100644 --- a/testing/013/class_t2.xml +++ b/testing/013/class_t2.xml @@ -1,6 +1,6 @@ - + T2 013_class.h diff --git a/testing/013/class_t3.xml b/testing/013/class_t3.xml index 49e7a16..2fba932 100644 --- a/testing/013/class_t3.xml +++ b/testing/013/class_t3.xml @@ -1,6 +1,6 @@ - + T3 013_class.h diff --git a/testing/013/class_t4.xml b/testing/013/class_t4.xml index d87571d..907049f 100644 --- a/testing/013/class_t4.xml +++ b/testing/013/class_t4.xml @@ -1,6 +1,6 @@ - + T4 inc/013_class.h diff --git a/testing/015/015__cond_8c.xml b/testing/015/015__cond_8c.xml index 39baed7..fb3a06c 100644 --- a/testing/015/015__cond_8c.xml +++ b/testing/015/015__cond_8c.xml @@ -1,6 +1,6 @@ - + 015_cond.c diff --git a/testing/016/016__copydoc_8c.xml b/testing/016/016__copydoc_8c.xml index dd1de8f..992122d 100644 --- a/testing/016/016__copydoc_8c.xml +++ b/testing/016/016__copydoc_8c.xml @@ -1,6 +1,6 @@ - + 016_copydoc.c diff --git a/testing/018/018__def_8c.xml b/testing/018/018__def_8c.xml index b55a2eb..0b30670 100644 --- a/testing/018/018__def_8c.xml +++ b/testing/018/018__def_8c.xml @@ -1,6 +1,6 @@ - + 018_def.c diff --git a/testing/025/class_test.xml b/testing/025/class_test.xml index 8d3f076..f0c7abd 100644 --- a/testing/025/class_test.xml +++ b/testing/025/class_test.xml @@ -1,6 +1,6 @@ - + Test diff --git a/testing/026/class_test.xml b/testing/026/class_test.xml index f49cc8d..a332757 100644 --- a/testing/026/class_test.xml +++ b/testing/026/class_test.xml @@ -1,6 +1,6 @@ - + Test diff --git a/testing/027/struct_car.xml b/testing/027/struct_car.xml index 0e40922..c73ad34 100644 --- a/testing/027/struct_car.xml +++ b/testing/027/struct_car.xml @@ -1,6 +1,6 @@ - + Car Vehicle diff --git a/testing/027/struct_object.xml b/testing/027/struct_object.xml index 107548d..4047446 100644 --- a/testing/027/struct_object.xml +++ b/testing/027/struct_object.xml @@ -1,6 +1,6 @@ - + Object Vehicle diff --git a/testing/027/struct_truck.xml b/testing/027/struct_truck.xml index 1da9e2f..14ebde2 100644 --- a/testing/027/struct_truck.xml +++ b/testing/027/struct_truck.xml @@ -1,6 +1,6 @@ - + Truck Vehicle diff --git a/testing/027/struct_vehicle.xml b/testing/027/struct_vehicle.xml index a1f7654..bf480e8 100644 --- a/testing/027/struct_vehicle.xml +++ b/testing/027/struct_vehicle.xml @@ -1,6 +1,6 @@ - + Vehicle Object Car diff --git a/testing/029/029__hideinit_8c.xml b/testing/029/029__hideinit_8c.xml index 4bf1516..f5db794 100644 --- a/testing/029/029__hideinit_8c.xml +++ b/testing/029/029__hideinit_8c.xml @@ -1,6 +1,6 @@ - + 029_hideinit.c diff --git a/testing/035/035__invariant_8c.xml b/testing/035/035__invariant_8c.xml index d036388..f1a924d 100644 --- a/testing/035/035__invariant_8c.xml +++ b/testing/035/035__invariant_8c.xml @@ -1,6 +1,6 @@ - + 035_invariant.c diff --git a/testing/036/036__link_8c.xml b/testing/036/036__link_8c.xml index 4347d4b..c0dea58 100644 --- a/testing/036/036__link_8c.xml +++ b/testing/036/036__link_8c.xml @@ -1,6 +1,6 @@ - + 036_link.c Test diff --git a/testing/037/class_receiver.xml b/testing/037/class_receiver.xml index eb37d47..fc63646 100644 --- a/testing/037/class_receiver.xml +++ b/testing/037/class_receiver.xml @@ -1,6 +1,6 @@ - + Receiver diff --git a/testing/037/class_sender.xml b/testing/037/class_sender.xml index 117ed93..4254384 100644 --- a/testing/037/class_sender.xml +++ b/testing/037/class_sender.xml @@ -1,6 +1,6 @@ - + Sender diff --git a/testing/039/class_test.xml b/testing/039/class_test.xml index 3f38916..244e88d 100644 --- a/testing/039/class_test.xml +++ b/testing/039/class_test.xml @@ -1,6 +1,6 @@ - + Test
A group of functions.
diff --git a/testing/040/namespace_n_s.xml b/testing/040/namespace_n_s.xml index 14ffc26..64beb23 100644 --- a/testing/040/namespace_n_s.xml +++ b/testing/040/namespace_n_s.xml @@ -1,6 +1,6 @@ - + NS diff --git a/testing/041/class_test.xml b/testing/041/class_test.xml index 294b67c..7068026 100644 --- a/testing/041/class_test.xml +++ b/testing/041/class_test.xml @@ -1,6 +1,6 @@ - + Test diff --git a/testing/042/namespaceorg_1_1doxygen_1_1_test.xml b/testing/042/namespaceorg_1_1doxygen_1_1_test.xml index b48c307..7ed33d5 100644 --- a/testing/042/namespaceorg_1_1doxygen_1_1_test.xml +++ b/testing/042/namespaceorg_1_1doxygen_1_1_test.xml @@ -1,6 +1,6 @@ - + org::doxygen::Test diff --git a/testing/044/struct_s.xml b/testing/044/struct_s.xml index 9505f8c..2aa62c2 100644 --- a/testing/044/struct_s.xml +++ b/testing/044/struct_s.xml @@ -1,6 +1,6 @@ - + S 044_section.h diff --git a/testing/046/046__related_8cpp.xml b/testing/046/046__related_8cpp.xml index 0291e84..9f5eab6 100644 --- a/testing/046/046__related_8cpp.xml +++ b/testing/046/046__related_8cpp.xml @@ -1,6 +1,6 @@ - + 046_related.cpp Test diff --git a/testing/046/class_test.xml b/testing/046/class_test.xml index 3c631ab..62712d4 100644 --- a/testing/046/class_test.xml +++ b/testing/046/class_test.xml @@ -1,6 +1,6 @@ - + Test diff --git a/testing/047/047__return_8cpp.xml b/testing/047/047__return_8cpp.xml index 2ed45d1..b57a0c3 100644 --- a/testing/047/047__return_8cpp.xml +++ b/testing/047/047__return_8cpp.xml @@ -1,6 +1,6 @@ - + 047_return.cpp diff --git a/testing/048/048__showinit_8c.xml b/testing/048/048__showinit_8c.xml index a44ccb9..34b2c1c 100644 --- a/testing/048/048__showinit_8c.xml +++ b/testing/048/048__showinit_8c.xml @@ -1,6 +1,6 @@ - + 048_showinit.c diff --git a/testing/054/054__parblock_8cpp.xml b/testing/054/054__parblock_8cpp.xml index a562a6d..ae6e462 100644 --- a/testing/054/054__parblock_8cpp.xml +++ b/testing/054/054__parblock_8cpp.xml @@ -1,6 +1,6 @@ - + 054_parblock.cpp diff --git a/testing/057/057__caller__graphs_8tcl.xml b/testing/057/057__caller__graphs_8tcl.xml index 4c54e1c..c3dfb78 100644 --- a/testing/057/057__caller__graphs_8tcl.xml +++ b/testing/057/057__caller__graphs_8tcl.xml @@ -1,6 +1,6 @@ - + 057_caller_graphs.tcl bar foo diff --git a/testing/057/__057__caller__graphs_8tcl.xml b/testing/057/__057__caller__graphs_8tcl.xml index 2fdcf6a..48ab815 100644 --- a/testing/057/__057__caller__graphs_8tcl.xml +++ b/testing/057/__057__caller__graphs_8tcl.xml @@ -1,6 +1,6 @@ - + _057_caller_graphs.tcl diff --git a/testing/057/namespace1.xml b/testing/057/namespace1.xml index e74d8fe..6a40cc4 100644 --- a/testing/057/namespace1.xml +++ b/testing/057/namespace1.xml @@ -1,6 +1,6 @@ - + 1 1::1 diff --git a/testing/057/namespace1_1_11.xml b/testing/057/namespace1_1_11.xml index e5c5596..8ff3ce9 100644 --- a/testing/057/namespace1_1_11.xml +++ b/testing/057/namespace1_1_11.xml @@ -1,6 +1,6 @@ - + 1::1 1::1::1 diff --git a/testing/057/namespace1_1_11_1_11.xml b/testing/057/namespace1_1_11_1_11.xml index caccbe4..f7f9716 100644 --- a/testing/057/namespace1_1_11_1_11.xml +++ b/testing/057/namespace1_1_11_1_11.xml @@ -1,6 +1,6 @@ - + 1::1::1 diff --git a/testing/057/namespace2.xml b/testing/057/namespace2.xml index 6ea122c..0ce04a8 100644 --- a/testing/057/namespace2.xml +++ b/testing/057/namespace2.xml @@ -1,6 +1,6 @@ - + 2 2::2 diff --git a/testing/057/namespace2_1_12.xml b/testing/057/namespace2_1_12.xml index d2a589a..af86ebe 100644 --- a/testing/057/namespace2_1_12.xml +++ b/testing/057/namespace2_1_12.xml @@ -1,6 +1,6 @@ - + 2::2 2::2::2 diff --git a/testing/057/namespace2_1_12_1_12.xml b/testing/057/namespace2_1_12_1_12.xml index d04a73c..0a6d7fa 100644 --- a/testing/057/namespace2_1_12_1_12.xml +++ b/testing/057/namespace2_1_12_1_12.xml @@ -1,6 +1,6 @@ - + 2::2::2 2::2::2::2 diff --git a/testing/057/namespace2_1_12_1_12_1_12.xml b/testing/057/namespace2_1_12_1_12_1_12.xml index 980906d..461d61e 100644 --- a/testing/057/namespace2_1_12_1_12_1_12.xml +++ b/testing/057/namespace2_1_12_1_12_1_12.xml @@ -1,6 +1,6 @@ - + 2::2::2::2 2::2::2::2::2 diff --git a/testing/057/namespace2_1_12_1_12_1_12_1_12.xml b/testing/057/namespace2_1_12_1_12_1_12_1_12.xml index 0c6957b..3981ff0 100644 --- a/testing/057/namespace2_1_12_1_12_1_12_1_12.xml +++ b/testing/057/namespace2_1_12_1_12_1_12_1_12.xml @@ -1,6 +1,6 @@ - + 2::2::2::2::2 diff --git a/testing/057/namespacebar.xml b/testing/057/namespacebar.xml index 3c0f6e9..85cde41 100644 --- a/testing/057/namespacebar.xml +++ b/testing/057/namespacebar.xml @@ -1,6 +1,6 @@ - + bar diff --git a/testing/057/namespacefoo.xml b/testing/057/namespacefoo.xml index 2aae8ea..0d81332 100644 --- a/testing/057/namespacefoo.xml +++ b/testing/057/namespacefoo.xml @@ -1,6 +1,6 @@ - + foo diff --git a/testing/058/058__bracket__recursion_8tcl.xml b/testing/058/058__bracket__recursion_8tcl.xml index fd36cee..dcb60e4 100644 --- a/testing/058/058__bracket__recursion_8tcl.xml +++ b/testing/058/058__bracket__recursion_8tcl.xml @@ -1,6 +1,6 @@ - + 058_bracket_recursion.tcl diff --git a/testing/059/059__command__catch_8tcl.xml b/testing/059/059__command__catch_8tcl.xml index 6604413..a12a366 100644 --- a/testing/059/059__command__catch_8tcl.xml +++ b/testing/059/059__command__catch_8tcl.xml @@ -1,6 +1,6 @@ - + 059_command_catch.tcl diff --git a/testing/060/060__command__switch_8tcl.xml b/testing/060/060__command__switch_8tcl.xml index 05e01c6..f1792f4 100644 --- a/testing/060/060__command__switch_8tcl.xml +++ b/testing/060/060__command__switch_8tcl.xml @@ -1,6 +1,6 @@ - + 060_command_switch.tcl diff --git a/testing/061/class_test.xml b/testing/061/class_test.xml index 0922539..b233e9c 100644 --- a/testing/061/class_test.xml +++ b/testing/061/class_test.xml @@ -1,6 +1,6 @@ - + Test diff --git a/testing/062/namespacen1.xml b/testing/062/namespacen1.xml index 0ef31ff..a31fc29 100644 --- a/testing/062/namespacen1.xml +++ b/testing/062/namespacen1.xml @@ -1,6 +1,6 @@ - + n1 n1::n1 diff --git a/testing/062/namespacen2.xml b/testing/062/namespacen2.xml index 39c21d2..29c4d80 100644 --- a/testing/062/namespacen2.xml +++ b/testing/062/namespacen2.xml @@ -1,6 +1,6 @@ - + n2 n2::n2 diff --git a/testing/062/namespacen3.xml b/testing/062/namespacen3.xml index 25c803c..bfc1364 100644 --- a/testing/062/namespacen3.xml +++ b/testing/062/namespacen3.xml @@ -1,6 +1,6 @@ - + n3 n3::n3 diff --git a/testing/063/namespaceoo.xml b/testing/063/namespaceoo.xml index eb0c93c..044c364 100644 --- a/testing/063/namespaceoo.xml +++ b/testing/063/namespaceoo.xml @@ -1,6 +1,6 @@ - + oo oo::define oo::Helpers diff --git a/testing/063/namespaceoo_1_1_helpers.xml b/testing/063/namespaceoo_1_1_helpers.xml index ff309cf..40b4830 100644 --- a/testing/063/namespaceoo_1_1_helpers.xml +++ b/testing/063/namespaceoo_1_1_helpers.xml @@ -1,6 +1,6 @@ - + oo::Helpers diff --git a/testing/063/namespaceoo_1_1define.xml b/testing/063/namespaceoo_1_1define.xml index aa62fbd..214b705 100644 --- a/testing/063/namespaceoo_1_1define.xml +++ b/testing/063/namespaceoo_1_1define.xml @@ -1,6 +1,6 @@ - + oo::define -- cgit v0.12