generateString method
Generates necessary code for a SteamParam as String
Implementation
String generateString({
bool withDart = false,
bool withFunctionDart = false,
bool withFunctionC = false,
bool withName = false,
bool withCaller = false,
}) {
Token token = type.toToken();
StringBuffer sb = StringBuffer();
if (withDart) {
sb.write(token.typeDart);
}
if (withFunctionDart) {
sb.write(token.typeFfiDart);
}
if (withFunctionC) {
sb.write(token.typeFfiC);
}
if (withName) {
sb.write(" ${name.clearSteamNaming().camelCase}");
}
if (withCaller) {
sb.write(
" ${token.caller.replaceAll("{0}", name.clearSteamNaming().camelCase)}",
);
}
sb.write(",");
return sb.toString();
}