arsd.declarativeloader

A declarative file/stream loader/saver. You define structs with a handful of annotations, this read and writes them to/from files.

Members

Enums

BigEndian
enum BigEndian
LittleEndian
enum LittleEndian
NotSaved
enum NotSaved

The marked field is not in the actual file

VariableLength
enum VariableLength

@VariableLength indicates the value is saved in a MIDI like format

Functions

MustBe
auto MustBe(T t)

Insists the field must be a certain value, like for magic numbers

Tag
auto Tag(T t)

@Tagged!Field indicates a tagged union. Each struct within should have @Tag(X) which is a value of Field

loadFrom
int loadFrom(T t, Range r, bool assumeBigEndian)

input range of ubytes...

saveTo
int saveTo(T t, Range r, bool assumeBigEndian)

Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

bigEndian
bool bigEndian(bool def)

Undocumented in source. Be warned that the author may not have intended to support it.

fieldPresent
bool fieldPresent(T t)

Undocumented in source. Be warned that the author may not have intended to support it.

fieldSaved
bool fieldSaved()

Undocumented in source. Be warned that the author may not have intended to support it.

getTag
auto getTag()

Undocumented in source. Be warned that the author may not have intended to support it.

Structs

MustBeStruct
struct MustBeStruct(T)

Undocumented in source.

NumBytes
struct NumBytes(alias field)
NumElements
struct NumElements(alias field)

@NumBytes!Field or @NumElements!Field controls length of embedded arrays

TagStruct
struct TagStruct(T)

Undocumented in source.

Tagged
struct Tagged(alias field)

@Tagged!Field indicates a tagged union. Each struct within should have @Tag(X) which is a value of Field

presentIf
struct presentIf

For example @presentIf("version >= 2") int addedInVersion2;

Unions

N
union N(ty)

Undocumented in source.

Meta