Documentation

FileReadStruct

The function reads contents into a structure passed as a parameter from a bin-file, starting with the current position of the file pointer.

uint  FileReadStruct(
   int                file_handle      // File handle
   any_simple_struct  str_object,      // target structure to read to
   int                size=-1          // structure size in bytes
   );

Parameters

file_handle

[in] File descriptor of an open bin-file.

str_object

[out]  The object of this structure. The structure should not contain strings, dynamic arrays or virtual functions.

size=-1

[in]  Number of bytes that should be read. If size is not specified or the indicated value is greater than the size of the structure, the exact size of the specified structure is used.

Return Value

If successful the function returns the number of bytes read. File pointer is moved by the same number of bytes.

See also

Structures and classes