Public Member Functions | List of all members
BtrieveBulkRetrieveResult Class Reference

The Btrieve bulk retrieve result class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveBulkRetrieveResult ()
 
 ~BtrieveBulkRetrieveResult ()
 
Btrieve::StatusCode GetLastStatusCode ()
 Get the last status code. More...
 
int GetRecord (int recordNumber, char *record, int recordSize)
 Get the record. More...
 
int GetRecordCount ()
 Get the record count. More...
 
long long GetRecordCursorPosition (int recordNumber)
 Get the record cursor position. More...
 
int GetRecordLength (int recordNumber)
 Get the record length. More...
 

Detailed Description

The Btrieve bulk retrieve result class.

Examples:
bfilter.cpp, and btestbulk.cpp.

Constructor & Destructor Documentation

◆ BtrieveBulkRetrieveResult()

BtrieveBulkRetrieveResult::BtrieveBulkRetrieveResult ( )
Snippet
BtrieveBulkRetrieveResult btrieveBulkRetrieveResult;

◆ ~BtrieveBulkRetrieveResult()

BtrieveBulkRetrieveResult::~BtrieveBulkRetrieveResult ( )

Member Function Documentation

◆ GetLastStatusCode()

Btrieve::StatusCode BtrieveBulkRetrieveResult::GetLastStatusCode ( )

Get the last status code.

Snippet
// If GetRecord() fails.
if (btrieveBulkRetrieveResult.GetRecord(1, (char *)&record, sizeof(record)) != sizeof(record))
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecord():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples:
bfilter.cpp, and btestbulk.cpp.

◆ GetRecord()

int BtrieveBulkRetrieveResult::GetRecord ( int  recordNumber,
char *  record,
int  recordSize 
)

Get the record.

Parameters
[in]recordNumberThe record number.
[out]recordThe record.
[in]recordSizeThe record size.
Snippet
// If GetRecord() fails.
if (btrieveBulkRetrieveResult.GetRecord(1, (char *)&record, sizeof(record)) != sizeof(record))
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecord():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Return values
>= 0The number of bytes read. The number of bytes read is limited to Btrieve::MAXIMUM_RECORD_LENGTH. See BtrieveFile::RecordRetrieveChunk for retrieving records greater than Btrieve::MAXIMUM_RECORD_LENGTH in length.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples:
bfilter.cpp, and btestbulk.cpp.

◆ GetRecordCount()

int BtrieveBulkRetrieveResult::GetRecordCount ( )

Get the record count.

Snippet
// If GetRecordCount() fails.
if ((i = btrieveBulkRetrieveResult.GetRecordCount()) != 1)
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecordCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Return values
>= 0The record count.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples:
bfilter.cpp, and btestbulk.cpp.

◆ GetRecordCursorPosition()

long long BtrieveBulkRetrieveResult::GetRecordCursorPosition ( int  recordNumber)

Get the record cursor position.

Note
The signature for this method changed in PSQL 13.20.
Parameters
[in]recordNumberThe record number.
Snippet
// If GetRecordCursorPosition() fails.
if ((cursorPosition = btrieveBulkRetrieveResult.GetRecordCursorPosition(1)) < 0)
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecordCursorPosition():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Return values
>= 0The record cursor position.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples:
bfilter.cpp, and btestbulk.cpp.

◆ GetRecordLength()

int BtrieveBulkRetrieveResult::GetRecordLength ( int  recordNumber)

Get the record length.

Parameters
[in]recordNumberThe record number.
Snippet
// If GetRecordLength() fails.
if ((i = btrieveBulkRetrieveResult.GetRecordLength(1)) != sizeof(record))
{
status = btrieveBulkRetrieveResult.GetLastStatusCode();
printf("Error: BtrieveBulkRetrieveResult::GetRecordLength():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Return values
>= 0The record length.
-1An error has occurred. Use BtrieveBulkRetrieveResult::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error.
Examples:
bfilter.cpp, and btestbulk.cpp.