![]() |
Section 8.10.3.7: |
This class implements a model of a cursor (and associated buffer) into a binary file.
The following routines are required to be implemented for this class in accordance with the specifications given in the abstract class $FILE_CURSORS :-
This is the single 'input' feature associated with the cursor, it allows for arbitrary reading of octets from the current position, updating that position as reading continues.
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.
This first variant of plus places the value of the single octet item at the current position in the file buffer.
This feature sets the value of item into the current file position in the file buffer associated with this cursor.
This second variant of plus places the value of the single octet item at the current position in the file buffer and then returns the cursor.
This feature makes the value of the current file position equal to item and moves the cursor forward by one.
This is the first of the two features which are provided to send a binary string of data to the file associated with this cursor, extending the length of the file as needed.
This feature appends the given item at the current position in the file buffer. The cursor position is moved forward by the size of the binary string. This action may or may not involve writing to the underlying file.
This is the second feature provided to send a binary string of data to the file associated with this cursor, extending the length of the file as needed. This one returns the cursor itself.
This feature sets the file contents for the number of octets in the binary string to be the values of the binary string. The cursor position is moved forward by that number of octets. The cursor itself is then returned.
This feature ensures that any buffer contents which has not been written to the file has been written, synchronising the program with the file store.
This is vacuously true.
Any output which has been sent to the file since either it was opened or the most recent previous call of this routine, will be forced out to synchronise the file with the program.
This routine flushes the cursor buffer to the file, ensuring that file and program are synchronised.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Input/Output Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Monday, 17 July 2000. |
![]() |