jArgs
context(placement: NativePlacement)
inline fun jArgs(count: Int, block: JArgumentsBuilder.() -> Unit): JArguments(source)
inline fun jArgs(count: Int, block: JArgumentsBuilder.() -> Unit): JArguments(source)
Allocates and initializes JArguments.
Instead of writing
val args = allocArray<JValue>(4)
var i = 0
args[i++].int = 13
args[i++].ref = "string".toJString()
args[i++].char = 'c'
args[i++].boolean = trueContent copied to clipboard
You may write
val args = jArgs(4) { int(13); str("string"); char('c'); boolean(true) }Content copied to clipboard
Which will be inlined in the code above.
Parameters
count
size of an array to allocate
block
array initializer block