Skip to content

UXRscWriter

UXRscWriter writes a UXRscDoc. From 0.7 (earlier it was part of Rocks).

#import "UXRscWrite.xc"
Data* bytes = UXRscWriter.write(doc);

The output is a big-endian classic .rsc, readable by GEM resource tools. When the document has layout variants, an rsc file graph or names, a version 3 rsc chunk follows at rsh_rssize, where a classic AES does not look. A document without either is written as a plain classic file.

Trees and objects can have names (a tree’s name, an object’s name). The classic format has nowhere to keep them, so they go in a NAME section of the chunk, and a document with names always has one.

Reading a file and writing it back gives the same bytes.

write · writer · emit · warning · wasLossless · seq

static Data* write(UXRscDoc* r)
static UXRscWriter* writer(UXRscDoc* r)

The writer, for its warning; call emit for the bytes.

Data* emit(UXRscDoc* r)
u8* warning(void)

What the file could not carry, or null.

bool wasLossless(void)
static bool seq(u8* a, u8* b)

Whether two C strings are equal.