Btrieve 2
|
The Btrieve file class. More...
#include <btrieveCpp.h>
Public Member Functions | |
BtrieveFile () | |
~BtrieveFile () | |
Btrieve::StatusCode | BulkCreate (BtrieveBulkCreatePayload *btrieveBulkCreatePayload, BtrieveBulkCreateResult *btrieveBulkCreateResult) |
Bulk create. | |
Btrieve::StatusCode | BulkDeleteNext (BtrieveBulkDeleteAttributes *bulkDeleteAttributes, BtrieveBulkDeleteResult *bulkDeleteResult) |
Delete bulk next. | |
Btrieve::StatusCode | BulkDeletePrevious (BtrieveBulkDeleteAttributes *bulkDeleteAttributes, BtrieveBulkDeleteResult *bulkDeleteResult) |
Delete bulk previous. | |
Btrieve::StatusCode | BulkRetrieveNext (BtrieveBulkRetrieveAttributes *bulkRetrieveAttributes, BtrieveBulkRetrieveResult *bulkRetrieveResult, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve bulk next. | |
Btrieve::StatusCode | BulkRetrievePrevious (BtrieveBulkRetrieveAttributes *bulkRetrieveAttributes, BtrieveBulkRetrieveResult *bulkRetrieveResult, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve bulk previous. | |
long long | GetCursorPosition () |
Get the cursor position. | |
Btrieve::StatusCode | GetInformation (BtrieveFileInformation *btrieveFileInformation) |
Get the file information. | |
Btrieve::StatusCode | GetLastStatusCode () |
Get the last status code. | |
int | GetNumerator (Btrieve::Index index, const char *key, int keyLength, int denominator) |
Get the numerator which best approximates the location of the key within the index relative to the denominator. | |
int | GetNumerator (long long cursorPosition, int denominator) |
Get the numerator which best approximates the location of the cursor position within the file relative to the denominator. | |
int | GetPercentage (Btrieve::Index index, const char *key, int keyLength) |
Get the percentage which best approximates the location of the key within the given index. | |
int | GetPercentage (long long cursorPosition) |
Get the percentage which best approximates the location of the cursor position within the file. | |
long long | GetRecordCreateTime () |
Get the record create time. | |
long long | GetRecordUpdateTime () |
Get the record update time. | |
Btrieve::StatusCode | IndexCreate (BtrieveIndexAttributes *btrieveIndexAttributes) |
Create an index. | |
Btrieve::StatusCode | IndexDrop (Btrieve::Index index) |
Drop an index. | |
Btrieve::StatusCode | KeyRetrieve (Btrieve::Comparison comparison, Btrieve::Index index, char *key, int keyLength) |
Retrieve a key using the given comparison, index, and key. | |
Btrieve::StatusCode | KeyRetrieveFirst (Btrieve::Index index, char *key, int keySize) |
Retrieve the first key. | |
Btrieve::StatusCode | KeyRetrieveLast (Btrieve::Index index, char *key, int keySize) |
Retrieve the last key. | |
Btrieve::StatusCode | KeyRetrieveNext (char *key, int keySize) |
Retrieve the next key. | |
Btrieve::StatusCode | KeyRetrievePrevious (char *key, int keySize) |
Retrieve the previous key. | |
Btrieve::StatusCode | RecordAppendChunk (const char *chunk, int chunkLength) |
Append a record chunk. | |
Btrieve::StatusCode | RecordCreate (char *record, int recordLength) |
Create a record. | |
Btrieve::StatusCode | RecordDelete () |
Delete a record. | |
Btrieve::StatusCode | RecordDeleteChunk (int chunkLength) |
Delete a record chunk at the current offset. | |
Btrieve::StatusCode | RecordDeleteChunk (int offset, int chunkLength) |
Delete a record chunk. | |
Btrieve::StatusCode | RecordInsertChunk (const char *chunk, int chunkLength) |
Insert a record chunk at the current offset. | |
Btrieve::StatusCode | RecordInsertChunk (int offset, const char *chunk, int chunkLength) |
Insert a record chunk. | |
int | RecordRetrieve (Btrieve::Comparison comparison, Btrieve::Index index, char *key, int keyLength, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record using the given comparison, index, and key. | |
int | RecordRetrieveByCursorPosition (Btrieve::Index index, long long cursorPosition, char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record by cursor position. | |
int | RecordRetrieveByCursorPosition (Btrieve::Index index, long long cursorPosition, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record by cursor position. | |
int | RecordRetrieveByFraction (Btrieve::Index index, int numerator, int denominator, char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record by fraction. | |
int | RecordRetrieveByFraction (Btrieve::Index index, int numerator, int denominator, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record by fraction. | |
int | RecordRetrieveByPercentage (Btrieve::Index index, int percentage, char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record by percentage. | |
int | RecordRetrieveByPercentage (Btrieve::Index index, int percentage, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record by percentage. | |
int | RecordRetrieveChunk (int length, char *chunk, int chunkSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record chunk at the current offset. | |
int | RecordRetrieveChunk (int offset, int length, char *chunk, int chunkSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve a record chunk. | |
int | RecordRetrieveFirst (Btrieve::Index index, char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the first record. | |
int | RecordRetrieveFirst (Btrieve::Index index, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the first record. | |
int | RecordRetrieveLast (Btrieve::Index index, char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the last record. | |
int | RecordRetrieveLast (Btrieve::Index index, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the last record. | |
int | RecordRetrieveNext (char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the next record. | |
int | RecordRetrieveNext (char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the next record. | |
int | RecordRetrievePrevious (char *key, int keySize, char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the previous record. | |
int | RecordRetrievePrevious (char *record, int recordSize, Btrieve::LockMode lockMode=Btrieve::LOCK_MODE_NONE) |
Retrieve the previous record. | |
Btrieve::StatusCode | RecordTruncate () |
Truncate a record at the current offset. | |
Btrieve::StatusCode | RecordTruncate (int offset) |
Truncate a record. | |
Btrieve::StatusCode | RecordUnlock (Btrieve::UnlockMode unlockMode) |
Unlock a record or records. | |
Btrieve::StatusCode | RecordUpdate (const char *record, int recordLength) |
Update a record. | |
Btrieve::StatusCode | RecordUpdateChunk (const char *chunk, int chunkLength) |
Update a record chunk at the current offset. | |
Btrieve::StatusCode | RecordUpdateChunk (int offset, const char *chunk, int chunkLength) |
Update a record chunk. | |
Btrieve::StatusCode | SetOwner (Btrieve::OwnerMode ownerMode, const char *ownerName=NULL, const char *ownerNameAgain=NULL, bool useLongOwnerName=true) |
Set the owner. | |
Btrieve::StatusCode | UnlockCursorPosition (long long cursorPosition) |
Unlock the cursor position. | |
The Btrieve file class.
In order to retrieve, update, and delete records in a Btrieve file the cursor must be established. The following methods are among those used to establish the cursor:
Once established, the cursor enables traversal over the records in the file. The following methods are among those used to traverse over the file:
The cursor may be re-established repeatedly.
BtrieveFile::BtrieveFile | ( | ) |
BtrieveFile::~BtrieveFile | ( | ) |
Btrieve::StatusCode BtrieveFile::BulkCreate | ( | BtrieveBulkCreatePayload * | btrieveBulkCreatePayload, |
BtrieveBulkCreateResult * | btrieveBulkCreateResult ) |
Bulk create.
[in] | btrieveBulkCreatePayload | The bulk create payload. |
[out] | btrieveBulkCreateResult | The bulk create result. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::BulkDeleteNext | ( | BtrieveBulkDeleteAttributes * | bulkDeleteAttributes, |
BtrieveBulkDeleteResult * | bulkDeleteResult ) |
Delete bulk next.
[in] | bulkDeleteAttributes | The bulk delete attributes. |
[out] | bulkDeleteResult | The bulk delete result. |
= Btrieve::STATUS_CODE_END_OF_FILE | Success. Zero or more records were deleted. There are no more records matching the given bulk delete attributes. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. One or more records were deleted. There may be more records matching the given bulk delete attributes. |
Otherwise | An error has occurred. |
Btrieve::StatusCode BtrieveFile::BulkDeletePrevious | ( | BtrieveBulkDeleteAttributes * | bulkDeleteAttributes, |
BtrieveBulkDeleteResult * | bulkDeleteResult ) |
Delete bulk previous.
[in] | bulkDeleteAttributes | The bulk delete attributes. |
[out] | bulkDeleteResult | The bulk delete result. |
= Btrieve::STATUS_CODE_END_OF_FILE | Success. Zero or more records were deleted. There are no more records matching the given bulk delete attributes. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. One or more records were deleted. There may be more records matching the given bulk delete attributes. |
Otherwise | An error has occurred. |
Btrieve::StatusCode BtrieveFile::BulkRetrieveNext | ( | BtrieveBulkRetrieveAttributes * | bulkRetrieveAttributes, |
BtrieveBulkRetrieveResult * | bulkRetrieveResult, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve bulk next.
[in] | bulkRetrieveAttributes | The bulk retrieve attributes. |
[out] | bulkRetrieveResult | The bulk retrieve result. |
[in] | lockMode | The lock mode. |
= Btrieve::STATUS_CODE_END_OF_FILE | Success. Zero or more records were retrieved. There are no more records matching the given bulk retrieve attributes. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. One or more records were retrieved. There may be more records matching the given bulk retrieve attributes. |
Otherwise | An error has occurred. |
Btrieve::StatusCode BtrieveFile::BulkRetrievePrevious | ( | BtrieveBulkRetrieveAttributes * | bulkRetrieveAttributes, |
BtrieveBulkRetrieveResult * | bulkRetrieveResult, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve bulk previous.
[in] | bulkRetrieveAttributes | The bulk retrieve attributes. |
[out] | bulkRetrieveResult | The bulk retrieve result. |
[in] | lockMode | The lock mode. |
= Btrieve::STATUS_CODE_END_OF_FILE | Success. Zero or more records were retrieved. There are no more records matching the given bulk retrieve attributes. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. One or more records were retrieved. There may be more records matching the given bulk retrieve attributes. |
Otherwise | An error has occurred. |
long long BtrieveFile::GetCursorPosition | ( | ) |
Get the cursor position.
>= 0 | The cursor position. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
Btrieve::StatusCode BtrieveFile::GetInformation | ( | BtrieveFileInformation * | btrieveFileInformation | ) |
Get the file information.
[out] | btrieveFileInformation | The file information. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::GetLastStatusCode | ( | ) |
Get the last status code.
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
int BtrieveFile::GetNumerator | ( | Btrieve::Index | index, |
const char * | key, | ||
int | keyLength, | ||
int | denominator ) |
Get the numerator which best approximates the location of the key within the index relative to the denominator.
[in] | index | The index. |
[in] | key | The key. |
[in] | keyLength | The key length. |
[in] | denominator | The denominator. |
>= 0 | The numerator returned as 0 through denominator. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::GetNumerator | ( | long long | cursorPosition, |
int | denominator ) |
Get the numerator which best approximates the location of the cursor position within the file relative to the denominator.
[in] | cursorPosition | The cursor position. |
[in] | denominator | The denominator. |
>= 0 | The numerator returned as 0 through denominator. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::GetPercentage | ( | Btrieve::Index | index, |
const char * | key, | ||
int | keyLength ) |
Get the percentage which best approximates the location of the key within the given index.
[in] | index | The index. |
[in] | key | The key. |
[in] | keyLength | The key length. |
>= 0 | The percentage returned as 0 through 10,000, corresponding to 0% through 100.00%. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::GetPercentage | ( | long long | cursorPosition | ) |
Get the percentage which best approximates the location of the cursor position within the file.
[in] | cursorPosition | The cursor position. |
>= 0 | The percentage returned as 0 through 10,000, corresponding to 0% through 100.00%. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
long long BtrieveFile::GetRecordCreateTime | ( | ) |
Get the record create time.
> 0 | The record create time as a Btrieve timestamp. |
= 0 | The record create time is unavailable. Ensure the file was created with system data. See BtrieveFileAttributes::SetSystemDataMode. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
long long BtrieveFile::GetRecordUpdateTime | ( | ) |
Get the record update time.
> 0 | The record update time as a Btrieve timestamp. |
= 0 | The record update time is unavailable. Ensure the file was created with system data version 2. See BtrieveFileAttributes::SetSystemDataMode. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
Btrieve::StatusCode BtrieveFile::IndexCreate | ( | BtrieveIndexAttributes * | btrieveIndexAttributes | ) |
Create an index.
[in] | btrieveIndexAttributes | The index attributes. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::IndexDrop | ( | Btrieve::Index | index | ) |
Drop an index.
[in] | index | The index. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::KeyRetrieve | ( | Btrieve::Comparison | comparison, |
Btrieve::Index | index, | ||
char * | key, | ||
int | keyLength ) |
Retrieve a key using the given comparison, index, and key.
[in] | comparison | The comparison. Btrieve::COMPARISON_NOT_EQUAL isn't supported. |
[in] | index | The index. |
[in,out] | key | The key. |
[in] | keyLength | The key length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::KeyRetrieveFirst | ( | Btrieve::Index | index, |
char * | key, | ||
int | keySize ) |
Retrieve the first key.
[in] | index | The index. |
[out] | key | The key. |
[in] | keySize | The key size. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::KeyRetrieveLast | ( | Btrieve::Index | index, |
char * | key, | ||
int | keySize ) |
Retrieve the last key.
[in] | index | The index. |
[out] | key | The key. |
[in] | keySize | The key size. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::KeyRetrieveNext | ( | char * | key, |
int | keySize ) |
Retrieve the next key.
[out] | key | The key. |
[in] | keySize | The key size. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::KeyRetrievePrevious | ( | char * | key, |
int | keySize ) |
Retrieve the previous key.
[out] | key | The key. |
[in] | keySize | The key size. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordAppendChunk | ( | const char * | chunk, |
int | chunkLength ) |
Append a record chunk.
[in] | chunk | The chunk. |
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordCreate | ( | char * | record, |
int | recordLength ) |
Create a record.
[in,out] | record | The record. If the current record contains a Btrieve::DATA_TYPE_AUTOINCREMENT or Btrieve::DATA_TYPE_AUTOTIMESTAMP key segment then the passed in record may be modifed. |
[in] | recordLength | The record length. Record length is limited to Btrieve::MAXIMUM_RECORD_LENGTH bytes. See BtrieveFile::RecordAppendChunk for creating records greater than Btrieve::MAXIMUM_RECORD_LENGTH in length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordDelete | ( | ) |
Delete a record.
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordDeleteChunk | ( | int | chunkLength | ) |
Delete a record chunk at the current offset.
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordDeleteChunk | ( | int | offset, |
int | chunkLength ) |
Delete a record chunk.
[in] | offset | The offset. If offset is -1, then the current offset is used. Offset must be within the variable length portion of the record. |
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordInsertChunk | ( | const char * | chunk, |
int | chunkLength ) |
Insert a record chunk at the current offset.
[in] | chunk | The chunk. |
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordInsertChunk | ( | int | offset, |
const char * | chunk, | ||
int | chunkLength ) |
Insert a record chunk.
[in] | offset | The offset. If offset is -1, then the current offset is used. Offset must be within the variable length portion of the record. |
[in] | chunk | The chunk. |
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
int BtrieveFile::RecordRetrieve | ( | Btrieve::Comparison | comparison, |
Btrieve::Index | index, | ||
char * | key, | ||
int | keyLength, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record using the given comparison, index, and key.
[in] | comparison | The comparison. Btrieve::COMPARISON_NOT_EQUAL isn't supported. |
[in] | index | The index. |
[in,out] | key | The key. |
[in] | keyLength | The key length. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveByCursorPosition | ( | Btrieve::Index | index, |
long long | cursorPosition, | ||
char * | key, | ||
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record by cursor position.
[in] | index | An index or Btrieve::INDEX_NONE. |
[in] | cursorPosition | The cursor position. |
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveByCursorPosition | ( | Btrieve::Index | index, |
long long | cursorPosition, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record by cursor position.
[in] | index | An index or Btrieve::INDEX_NONE. |
[in] | cursorPosition | The cursor position. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveByFraction | ( | Btrieve::Index | index, |
int | numerator, | ||
int | denominator, | ||
char * | key, | ||
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record by fraction.
[in] | index | An index or Btrieve::INDEX_NONE. |
[in] | numerator | The numerator given as 0 through denominator. |
[in] | denominator | The denominator. |
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveByFraction | ( | Btrieve::Index | index, |
int | numerator, | ||
int | denominator, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record by fraction.
[in] | index | An index or Btrieve::INDEX_NONE. |
[in] | numerator | The numerator given as 0 through denominator. |
[in] | denominator | The denominator. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveByPercentage | ( | Btrieve::Index | index, |
int | percentage, | ||
char * | key, | ||
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record by percentage.
[in] | index | An index or Btrieve::INDEX_NONE. |
[in] | percentage | The percentage given as 0 through 10,000, corresponding to 0% through 100.00%. |
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveByPercentage | ( | Btrieve::Index | index, |
int | percentage, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record by percentage.
[in] | index | An index or Btrieve::INDEX_NONE. |
[in] | percentage | The percentage given as 0 through 10,000, corresponding to 0% through 100.00%. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveChunk | ( | int | length, |
char * | chunk, | ||
int | chunkSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record chunk at the current offset.
[in] | length | The length. |
[out] | chunk | The chunk. |
[in] | chunkSize | The chunk size. |
[in] | lockMode | The lock mode. |
>= 0 | The number of bytes read. You may retrieve multiple chunks. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveChunk | ( | int | offset, |
int | length, | ||
char * | chunk, | ||
int | chunkSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve a record chunk.
[in] | offset | The offset. If offset is -1, then the current offset is used. |
[in] | length | The length. |
[out] | chunk | The chunk. |
[in] | chunkSize | The chunk size. |
[in] | lockMode | The lock mode. |
>= 0 | The number of bytes read. You may retrieve multiple chunks. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveFirst | ( | Btrieve::Index | index, |
char * | key, | ||
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the first record.
[in] | index | An index or Btrieve::INDEX_NONE. |
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveFirst | ( | Btrieve::Index | index, |
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the first record.
[in] | index | An index or Btrieve::INDEX_NONE. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveLast | ( | Btrieve::Index | index, |
char * | key, | ||
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the last record.
[in] | index | An index or Btrieve::INDEX_NONE. |
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveLast | ( | Btrieve::Index | index, |
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the last record.
[in] | index | An index or Btrieve::INDEX_NONE. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveNext | ( | char * | key, |
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the next record.
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrieveNext | ( | char * | record, |
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the next record.
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrievePrevious | ( | char * | key, |
int | keySize, | ||
char * | record, | ||
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the previous record.
[out] | key | The key. |
[in] | keySize | The key size. |
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
int BtrieveFile::RecordRetrievePrevious | ( | char * | record, |
int | recordSize, | ||
Btrieve::LockMode | lockMode = Btrieve::LOCK_MODE_NONE ) |
Retrieve the previous record.
[out] | record | The record. |
[in] | recordSize | The record size. |
[in] | lockMode | The lock mode. |
>= 0 | The 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. If the record size requested is less than the length of the current record then BtrieveFile::GetLastStatusCode will return Btrieve::STATUS_CODE_DATALENGTH_ERROR. |
-1 | An error has occurred. Use BtrieveFile::GetLastStatusCode to determine the Btrieve::StatusCode associated with any error. |
Btrieve::StatusCode BtrieveFile::RecordTruncate | ( | ) |
Truncate a record at the current offset.
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordTruncate | ( | int | offset | ) |
Truncate a record.
[in] | offset | The offset. If offset is -1, then the current offset is used. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordUnlock | ( | Btrieve::UnlockMode | unlockMode | ) |
Unlock a record or records.
[in] | unlockMode | The unlock mode. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordUpdate | ( | const char * | record, |
int | recordLength ) |
Update a record.
[in] | record | The record. |
[in] | recordLength | The record length. Record length is limited to Btrieve::MAXIMUM_RECORD_LENGTH bytes. See BtrieveFile::RecordUpdateChunk for updating records greater than Btrieve::MAXIMUM_RECORD_LENGTH in length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordUpdateChunk | ( | const char * | chunk, |
int | chunkLength ) |
Update a record chunk at the current offset.
[in] | chunk | The chunk. |
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::RecordUpdateChunk | ( | int | offset, |
const char * | chunk, | ||
int | chunkLength ) |
Update a record chunk.
[in] | offset | The offset. If offset is -1, then the current offset is used. |
[in] | chunk | The chunk. |
[in] | chunkLength | The chunk length. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::SetOwner | ( | Btrieve::OwnerMode | ownerMode, |
const char * | ownerName = NULL, | ||
const char * | ownerNameAgain = NULL, | ||
bool | useLongOwnerName = true ) |
Set the owner.
[in] | ownerMode | The owner mode. |
[in] | ownerName | The owner name. |
[in] | ownerNameAgain | The owner name (again). |
[in] | useLongOwnerName | Use a long owner name? |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |
Btrieve::StatusCode BtrieveFile::UnlockCursorPosition | ( | long long | cursorPosition | ) |
Unlock the cursor position.
[in] | cursorPosition | The cursor position. |
= Btrieve::STATUS_CODE_NO_ERROR | Success. |
!= Btrieve::STATUS_CODE_NO_ERROR | An error has occurred. |