![]() |
Section 8.10.3.8: |
![]() |
This class implements a model of a cursor (and associated buffer) into a file whose contents is text data in some encoding.
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{CHAR,STR} 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{CHAR,STR} :-
This feature retracts the cursor by one character position, making the new current position one less than previously.
retract | : SAME |
This routine moves the file cursor back by one character position and returns the resulting cursor.
This variant of skipping searches for the first occurrence of the given character in the file forward from the current cursor position.
This feature moves the cursor forward until the next occurrence of the given character or the end of the file, whichever occurs first.
This skip variant searches for the first occurrence of the given character in the file (if there is one) and then moves the cursor past it.
This feature moves the cursor forward until after the next occurrence of the given character or the end of the file, whichever occurs first.
This skip variant looks for the encoding which represents the end of line mark in the file encoding and repertoire and skips over it - or to the end of file.
This feature moves the cursor forward past the next end of line mark or to the end of the file, whichever occurs first.
This first input routine merely returns the next character in the file (which will always be a single encoding, but may be of up to four octets).
This feature returns a single character from the current cursor position, moving the position forward by as many octets as needed.
This input feature searches for the given character in the buffer on the current text line. The contents of the buffer up to either the character or the end of the line are returned as a string.
This feature returns a (possibly empty) text string up to the next occurrence of ch or up to the end of the current line of text or to the end of the file, whichever occurs first.
This final input feature returns the contents of the file up to but not including the next end of line mark.
This feature returns all of the characters remaining on the current line of text, advancing the cursor by as many places. The string returned does not include any end of line mark.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Input/Output Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Friday, 17 November 2000. |
![]() |