diff options
author | montellese <montellese@xbmc.org> | 2015-02-10 11:32:46 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2015-03-01 14:52:03 +0100 |
commit | 56b35c6ee8ee144129b9755d8c7892deece9b0ab (patch) | |
tree | 279f532a6cb64a6544d0116d779f8910710e975a /tools/codegenerator | |
parent | 95ef40a861a25c2262f0dc43bfbbbd06a68faa86 (diff) |
codegenerator: improve doxygen integration (thanks notspiff)
Diffstat (limited to 'tools/codegenerator')
-rw-r--r-- | tools/codegenerator/Helper.groovy | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy index 920c7d1b95..cdb7b3ed0e 100644 --- a/tools/codegenerator/Helper.groovy +++ b/tools/codegenerator/Helper.groovy @@ -85,10 +85,10 @@ public class Helper def ret = '' // make the class name or namespace - String doxygenId = findFullClassName(methodOrClass,'_1_1') + String doxygenId = findFullClassName(methodOrClass,'_1_1',true) boolean isInClass = doxygenId != null if (!doxygenId) - doxygenId = findNamespace(methodOrClass,'_1_1',false) + doxygenId = findNamespace(methodOrClass,'_1_1',false,true) doxygenId = (isInClass ? 'class' : 'namespace') + doxygenId String doxygenFilename = doxygenId + '.xml' @@ -593,7 +593,7 @@ public class Helper * If this node is a class node, or a child of a class name (for example, a method) then * the full classname, with the namespace will be returned. Otherwise, null. */ - public static String findFullClassName(Node node, String separator = '::') + public static String findFullClassName(Node node, String separator = '::', boolean filename = false) { String ret = null List rents = parents(node, { it.name() == 'class' }) @@ -605,21 +605,24 @@ public class Helper ret += separator + it.@sym_name } - return ret ? findNamespace(node,separator) + ret : null + return ret ? findNamespace(node,separator,true,filename) + ret : null } /** * Given the Node this method looks to see if it occurs within namespace and returns * the namespace as a String. It includes the trailing '::' */ - public static String findNamespace(Node node, String separator = '::', boolean endingSeparator = true) + public static String findNamespace(Node node, String separator = '::', boolean endingSeparator = true, boolean filename = false) { String ret = null parents(node, { it.name() == 'namespace' }).each { + String data = it.@name + if (filename) + data = data.replaceAll("_", "__") if (ret == null) - ret = it.@name + ret = data else - ret += separator + it.@name + ret += separator + data } return ret == null ? '' : (ret + (endingSeparator ? separator : '')) |