ClipboardIO.readClipboard

Read text from the clipboard.

This function works in the same way as FocusIO.readText: All the text will be written by reference into the provided buffer, overwriting previously stored text. The returned value will be a slice of this buffer, representing the entire value. The buffer may not fit the entire text. Because of this, the function should be called repeatedly until the returned value is null.

This function may not throw: In the instance the offset extends beyond text boundaries, the buffer is empty or text cannot be read, this function should return null, as if no text should remain to read.

interface ClipboardIO
nothrow
char[]
readClipboard
(
return scope char[] buffer
,
ref int offset
)
out (text; text is null || text.length > 0, "Returned value must be null if it is empty")

Parameters

buffer char[]

Buffer to write clipboard text into.

offset int

Index of the system clipboard to start writing from.

Return Value

Type: char[]

A slice of the buffer containing clipboard data, or null if no data remains to be written.

Meta