adding name of enum

pull/2/head
Volker Birk 2021-09-16 22:45:21 +02:00
parent ad03c720a3
commit fa419594c5
1 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ tstylesheet {
template "/enum"
||
import System;
using System;
namespace pEp {
enum «yml:CamelCase(@name)»
@ -23,14 +23,14 @@ tstylesheet {
}
`` apply "item", mode=exception
class UnknownErrorException : Exception { }
class UnknownTSCErrorException : Exception { }
class «yml:CamelCase(@name)»Converter {
public static void throwTSCError(TransportStatusCode tsc) {
switch (tsc) {
``apply "item", 4, mode=case
default:
throw new UnknownErrorException();
throw new UnknownTSCErrorException();
}
}
}
@ -58,7 +58,7 @@ tstylesheet {
}
template "item", mode=case {
| case «yml:CamelCase(@name)»:
| case TransportStatusCode.«yml:CamelCase(@name)»:
const "isError" call "isError" with "tsc", ".";
choose {
when "$isError > 127"