You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_FilePage object:
Cvo_FilePage
Cvo_Page
#include
<Cvo/FilePage.h++>
new
Cvo_FilePage ( { char *filename | FILE *stream } )
A Cvo_FilePage is a Cvo_Page which maps into a file. The file is either opened by the Cvo_FilePage constructor if filename is passed, or the already opened file identified by stream is used.
Unlike other types of Cvo_Page objects, the Cvo_FilePage does not keep the individual lines of the Cvo_Page in memory, rather, it caches a certain amount of lines and leaves the rest of the lines in the file. This makes it possible to have Cvo_Page objects opened up to files of tens or hundreds of thousands of lines.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
int NumberLines (
)
This function returns the number of lines in the file. It returns -1 if the file could not be opened.
void *GetLine (
CARD n,
[ Cvo_CharacterBuffer *cb ] )
Returns the line n of the file or NULL
if n is greater than the
number of lines in the file. The return value should be casted to
type char *
.
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.