Function readEPString

Reads a string in standard Extended Pascal string format.

string readEPString (
  ushort capacity,
  std.stdio.File file
);

This format consists of the string contents, truncated or padded with '\0' upto capacity, followed by two bytes (ushort) stating the length of the padding.

Parameters

NameDescription
capacity The length of the data section to be read, excluding the two byte suffix.
file The file to read from.

Returns

the string as read from file.

See Also

writeAsEPString, readEPShortString.

Example

enum str = "Jan Karel is een proleet";
import std.stdio;
File tmp = File.tmpfile();
writeAsEPString(str, 80, tmp);
tmp.flush;

assert(tmp.size == 82);

tmp.rewind;
assert(readEPString(80, tmp) == str);