Browse Source

Generate enum for exception as well (i.e. pEp_status) so that callbacks could return a status. Rename pEp_status to Status in pEp.yml2 to prevent strange CamelCasing in generated Java class

JNI-44
Edouard Tisserant 9 years ago
parent
commit
640412f257
  1. 6
      src/gen_java_Message.ysl2
  2. 2
      src/pEp.yml2

6
src/gen_java_Message.ysl2

@ -4,7 +4,7 @@ tstylesheet {
include ./textutils.ysl2
include ./types_java.ysl2
template "/namespace[@name='pEp']" apply "struct|enum", 0;
template "/namespace[@name='pEp']" apply "struct|enum|exception", 0;
template "struct" {
const "cname" call "toJava" with "type", "@name";
@ -45,7 +45,7 @@ tstylesheet {
||
}
template "enum" {
template "enum|exception" {
const "jname" call "toJava" with "type", "@name";
document("org/pEp/jniadapter/{$jname}.java", "text")
||
@ -57,7 +57,7 @@ tstylesheet {
||
}
template "enum", mode=inner {
template "enum|exception", mode=inner {
const "jname" call "CamelCase" with "text", "@name";
||
public enum «$jname» {

2
src/pEp.yml2

@ -7,7 +7,7 @@ decl struct @name;
decl basic @type @name;
namespace pEp {
exception pEp_status {
exception Status {
pEp_status_ok > 0
pEp_init_cannot_load_gpgme > 0x0110

Loading…
Cancel
Save