Skip to content

UXRscReader

UXRscReader reads a GEM resource into a UXRscDoc, on every backend. From 0.7 (earlier it was part of Rocks).

#import "UXRscRead.xc"
UXRscDoc* doc = UXRscReader.read(bytes, len);

It reads either byte order, packed or pixel coordinates, and the rsc chunk at rsh_rssize in any version (1, 2 or 3): forms and their layouts, logical ids, class overrides, top-level objects and connections. Extension sections it does not interpret are kept so that a save writes them back.

A payload it cannot represent yet is counted, not dropped quietly: wasLossless says whether anything was.

read · reader · warning · wasLossless

static UXRscDoc* read(u8* bytes, i32 n)

The document, or null when the bytes are not a resource.

static UXRscReader* reader(u8* bytes, i32 n)

The reader after reading, for its warning; the document is its result.

u8* warning(void)

What could not be kept, or null.

bool wasLossless(void)