RecordFileScan Class Reference

Class for executing scans of record files. More...

#include <RecordFileScan.h>

List of all members.

Public Member Functions

ReturnCode openScan (RecordFileHandle *fileHandle, RecordFileScanCondition *condition)
 Initialize a record file scan.
ReturnCode getNextRecord (Record *record)
 Get the next matching record.
ReturnCode closeScan ()
 Terminate the record file scan.


Detailed Description

Class for executing scans of record files.

This class provides clients the capability to perform scans over the records of a file, where a scan may be based on a specified condition. See method documentation below.


Member Function Documentation

ReturnCode RecordFileScan::openScan ( RecordFileHandle fileHandle,
RecordFileScanCondition condition 
)

Initialize a record file scan.

Parameters:
fileHandle The handle to the record file to be scanned
condition The selection condition for records to be returned
Opens a scan of the record file referred to by parameter fileHandle. Returns RC_OK on success, and other ReturnCode values otherwise. During the scan, only the records satisfying the specified condition (a comparison with a value) should be retrieved. If the condition parameter is a null pointer, then there is no condition and all records are retrieved during the scan. Otherwise, it points to a RecordFileScanCondition structure that specifies the attribute type, length, and offset within the record, the kind of comparison (see ComparisonOp), and the constant value to be compared against. You will need to dereference the appropriate member of the value union (value_i, value_f, or value_str) depending on the type. If a character string has length n, then the attribute and the value will each be exactly n bytes long. They will not necessarily be null-terminated.

Returns RC_OK on success, or a suitable error code on failure.

ReturnCode RecordFileScan::getNextRecord ( Record record  ) 

Get the next matching record.

Parameters:
record The record will be copied here
Get the next matching record in the file. Returns RC_OK on success, RC_EOF if there are no more matching records, and other ReturnCode values otherwise.

ReturnCode RecordFileScan::closeScan (  ) 

Terminate the record file scan.

Terminate the record file scan. Returns RC_OK on success, and other ReturnCode values otherwise.


The documentation for this class was generated from the following files:

Generated on Mon May 16 17:05:06 2011 by  doxygen 1.5.6