Module epcompat.string

Provides compatibility between D strings and the binary Extended Pascal formats of ShortString and String, for file i/o using the fromFile and toFile methods.

Special care is given to strings embedded in aggregate types such as structs and unions.

Functions

NameDescription
fromFile(s, f) Reads structs from file.
fromFile(f) Where s is an alias to a string annotated with either an @EPString(n) UDA or @EPShortString(n) UDA, reads s from file f in the appropriate Prospero formats.
readEPShortString(capacity, file) Reads a string in standard Pascal shortstring format.
readEPString(capacity, file) Reads a string in standard Extended Pascal string format.
toFile(s, f) Writes structs to file.
toFile(f) Where s is an alias to a string annotated with either an @EPString(n) UDA or @EPShortString(n) UDA, writes s to file f in the appropriate Prospero formats.
trim(str) Returns a string with any whitespace trimmed from str.
writeAsEPShortString(str, capacity, file) Writes a string to file in standard Pascal shortstring format.
writeAsEPString(str, capacity, file) Writes a string to file in standard Extended Pascal string format.

Structs

NameDescription
EPShortString To be used as an attribute to string members of structs for specifying the file format.
EPString To be used as an attribute to string members of structs for specifying the file format.