Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

BytesOfFile

This is a helper function that can be used to read a file into a byte string.

data = BytesOfFile("testapplet.bmp")

File paths

File paths referenced in the .cif file are processed by the Lua interpreter as code. The semantics are similar to how strings are interpreted by a C compiler and most other modern compilers. The "\" (backslash) is the commonly used Windows directory separator, and CIFC treats it as an escape character. All the following examples are valid:

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile(".\\graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("./graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("e:/qctp406/brewery/apiOne/
main/src/tools/cifc/graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("e:\\qctp406\\brewery\\apiOne\
\main\\src\\tools\\cifc\\graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("./Foo\ Bar/graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("./Foo Bar/graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("Foo Bar/graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("Foo Bar\\graphics00.bmp")),
}

ModRsc {
id = 0x1,
type = 6,
data = ImageRscData("image/bmp", BytesOfFile("e:\\qctp406\\brewery\\apiOne\
\main\\src\\tools\\cifc\\Foo Bar\\graphics00.bmp")),
}