diff options
author | Sven Gothel <[email protected]> | 2023-06-29 03:03:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-06-29 03:03:30 +0200 |
commit | a83dad9963b394ac3e7bb193c6da7d9a5004a40e (patch) | |
tree | a1ec8caad1d0c46ddb49a5e654493df6f8b1a50e /src/java/com/jogamp/gluegen/CodeGenUtils.java | |
parent | 809a7f84fcada7fbde8b7d0c226b78492fbfc616 (diff) |
GlueGen FunctionType: Factor out getParameterList(..) from toString(..) and drop 'void' and use typedef-name; MethodBinding: Add getCParameterList(..) and getJavaParameterList(..) for general usage similar to FunctionType.getParameterList()
Diffstat (limited to 'src/java/com/jogamp/gluegen/CodeGenUtils.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/CodeGenUtils.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/java/com/jogamp/gluegen/CodeGenUtils.java b/src/java/com/jogamp/gluegen/CodeGenUtils.java index 5442a24..aa7a4e2 100644 --- a/src/java/com/jogamp/gluegen/CodeGenUtils.java +++ b/src/java/com/jogamp/gluegen/CodeGenUtils.java @@ -57,6 +57,16 @@ public class CodeGenUtils { return Character.toLowerCase(string.charAt(0)) + string.substring(1); } + /** Appends `param` to `buf` while prepending a comman separator if `needsComma[0]` is true. Sets `needsComma[0]=true` afterwards. */ + public static StringBuilder addParameterToList(final StringBuilder buf, final String param, final boolean[] needsComma) { + if( needsComma[0] ) { + buf.append(", "); + } + buf.append(param); + needsComma[0] = true; + return buf; + } + /** * Given a java package name (e.g., "java.lang"), return the package as a * directory path (i.e., "java/lang"). |