Sather Home Page

Section 8.10.3.7:
BIN_FILE_CURSOR

class BIN_FILE_CURSOR < $FILE_CURSORS{OCTET,BINSTR}
$FILE_CURSORS

Inheritance map

Formal Types

types

SAME = BIN_FILE_CURSOR ;

This class implements a model of a cursor (and associated buffer) into a binary file, inheriting all but one feature definition from the abstract class $FILE_CURSORS{OCTET,BINSTR}.


External specifications

The following routines are required to be implemented for this class in accordance with the specifications given in the abstract class $FILE_CURSORS of which $FILE_CURSORS{OCTET,BINSTR} is a sub-type :-


The following 'output' routines are required to be implemented for this class in accordance with the specifications given in the abstract class $FILE_CURSORS{OCTET,BINSTR} :-


get

This is the single 'input' feature associated with the binary file cursor. It allows for arbitrary reading of octets from the current position, updating that position as reading continues.

get (
count : CARD
) : FBINSTR
Formal Signature
get(self : SAME, count : CARD) res : [FBINSTR]
Pre-condition
pre readable(self)
      and (count > 0)
Post-condition
post (at_end(self)
      and res = nil)
   or let idx = position(self) in
         res = buffer(idx, ..., (idx + count))

This routine returns the next count items in the file in a binary string buffer. If there is insufficient data in the file then void is returned.


Language Index Library Index Input/Output Index
Comments or enquiries should be made toKeith Hopper.
Page last modified: Wednesday, 4 April 2001.
Produced with Amaya