FileException.enforce

Enforces success of file I/O operation

  1. alias enforce = ErrnoException.enforce
  2. void enforce(bool ok, cstring filename, FILE* handle, istring file, int line)
    class FileException
    void
    enforce
    (
    bool ok
    ,,
    FILE* handle
    ,
    istring file = __FILE__
    ,
    int line = __LINE__
    )

Parameters

ok bool

I/O expression that returns false on failure

filename cstring

filename that was used for the I/O (only used in message formatting)

handle FILE*

file handle that was used for the I/O (can be null)

file istring

file where the enforce is called

line int

line where the enforce is called

Throws

this upon any of conditions: - !ok - handle has error status - handle has EOF status - errno != 0

Meta