Public Member Functions | List of all members
BtrieveFileAttributes Class Reference

The Btrieve file attributes class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveFileAttributes ()
 
 ~BtrieveFileAttributes ()
 
Btrieve::StatusCode SetBalancedIndexes (bool enableBalancedIndexes)
 Set balanced indexes. More...
 
Btrieve::StatusCode SetFileVersion (Btrieve::FileVersion fileVersion)
 Set the file version. More...
 
Btrieve::StatusCode SetFixedRecordLength (int fixedRecordLength)
 Set the fixed record length. More...
 
Btrieve::StatusCode SetFreeSpaceThreshold (Btrieve::FreeSpaceThreshold freeSpaceThreshold)
 Set the free space threshold. More...
 
Btrieve::StatusCode SetKeyOnly (bool enableKeyOnly)
 Set key only. More...
 
Btrieve::StatusCode SetPageSize (Btrieve::PageSize pageSize, bool enablePageCompression=false)
 Set the page size. More...
 
Btrieve::StatusCode SetPreallocatedPageCount (int preallocatedPageCount)
 Set the preallocated page count. More...
 
Btrieve::StatusCode SetRecordCompressionMode (Btrieve::RecordCompressionMode recordCompressionMode)
 Set record compression mode. More...
 
Btrieve::StatusCode SetReservedDuplicatePointerCount (int reservedDuplicatePointerCount)
 Set the reserved duplicate pointer count. More...
 
Btrieve::StatusCode SetSystemDataMode (Btrieve::SystemDataMode systemDataMode)
 Set the system data mode. More...
 
Btrieve::StatusCode SetVariableLengthRecordsMode (Btrieve::VariableLengthRecordsMode variableLengthRecordsMode)
 Set the variable length records mode. More...
 

Detailed Description

The Btrieve file attributes class.

Examples:
bfileattributes.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, btestvlr.cpp, and Test_BTRV2.cpp.

Constructor & Destructor Documentation

◆ BtrieveFileAttributes()

BtrieveFileAttributes::BtrieveFileAttributes ( )
Snippet
C++ btest.cpp
BtrieveFileAttributes btrieveFileAttributes;
Python btest.py
btrieveFileAttributes = btrievePython.BtrieveFileAttributes()
assert(btrieveFileAttributes != None)

◆ ~BtrieveFileAttributes()

BtrieveFileAttributes::~BtrieveFileAttributes ( )

Member Function Documentation

◆ SetBalancedIndexes()

Btrieve::StatusCode BtrieveFileAttributes::SetBalancedIndexes ( bool  enableBalancedIndexes)

Set balanced indexes.

Parameters
[in]enableBalancedIndexesEnable balanced indexes?
Description
Balanced indexes are disabled by default.
Snippet
// If SetBalancedIndexes() fails.
if ((status = btrieveFileAttributes.SetBalancedIndexes(true)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileAttributes::SetBalancedIndexes():%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:
bfileattributes.cpp.

◆ SetFileVersion()

Btrieve::StatusCode BtrieveFileAttributes::SetFileVersion ( Btrieve::FileVersion  fileVersion)

Set the file version.

Parameters
[in]fileVersionThe file version.
Description
File version defaults to Btrieve::FILE_VERSION_DEFAULT. A file version of Btrieve::FILE_VERSION_6_0 is mapped to Btrieve::FILE_VERSION_6_1.
Snippet
// If SetFileVersion() fails.
{
printf("Error: BtrieveFileAttributes::SetFileVersion():%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:
bfileattributes.cpp.

◆ SetFixedRecordLength()

Btrieve::StatusCode BtrieveFileAttributes::SetFixedRecordLength ( int  fixedRecordLength)

Set the fixed record length.

Parameters
[in]fixedRecordLengthThe fixed record length. The fixed record length must be between 1 and Btrieve::MAXIMUM_RECORD_LENGTH, inclusive.
Description
Fixed record length defaults to zero.
Snippet
C++ btest.cpp
// If SetFixedRecordLength() fails.
if ((status = btrieveFileAttributes.SetFixedRecordLength(sizeof(record_t))) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileAttributes::SetFixedRecordLength():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveFileAttributes.SetFixedRecordLength(recordLength)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetLogicalFixedRecordLength():%d,%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples:
bfileattributes.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, btestvlr.cpp, and Test_BTRV2.cpp.

◆ SetFreeSpaceThreshold()

Btrieve::StatusCode BtrieveFileAttributes::SetFreeSpaceThreshold ( Btrieve::FreeSpaceThreshold  freeSpaceThreshold)

Set the free space threshold.

Parameters
[in]freeSpaceThresholdThe free space threshold.
Description
Free space threshold defaults to Btrieve::FREE_SPACE_THRESHOLD_DEFAULT. The free space threshold setting is ignored unless variable length records are enabled.
Snippet
// If SetFreeSpaceThreshold() fails.
{
printf("Error: BtrieveFileAttributes::SetFreeSpaceThreshold():%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:
bfileattributes.cpp.

◆ SetKeyOnly()

Btrieve::StatusCode BtrieveFileAttributes::SetKeyOnly ( bool  enableKeyOnly)

Set key only.

Parameters
[in]enableKeyOnlyEnable key only?
Description
Key only is disabled by default. Enabling key only will cause the system data mode to be ignored.
Snippet
// If SetKeyOnly() fails.
if ((status = btrieveFileAttributes.SetKeyOnly(true)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileAttributes::SetKeyOnly():%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:
bkeyonly.cpp.

◆ SetPageSize()

Btrieve::StatusCode BtrieveFileAttributes::SetPageSize ( Btrieve::PageSize  pageSize,
bool  enablePageCompression = false 
)

Set the page size.

Parameters
[in]pageSizeThe page size.
[in]enablePageCompressionEnable page compression?
Description
Page size defaults to Btrieve::PAGE_SIZE_4096. Page compression is disabled by default and requires file version Btrieve::FILE_VERSION_9_5 or greater. Not all page sizes are valid for all file versions. Pages sizes greater than 4096 require file version Btrieve::FILE_VERSION_9_0 or greater. Pages sizes which are unsupported for a particular file version will be rounded up to the next supported size.
Snippet
// If SetPageSize() fails.
if ((status = btrieveFileAttributes.SetPageSize(Btrieve::PAGE_SIZE_16384, true)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileAttributes::SetPageSize():%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:
bfileattributes.cpp.

◆ SetPreallocatedPageCount()

Btrieve::StatusCode BtrieveFileAttributes::SetPreallocatedPageCount ( int  preallocatedPageCount)

Set the preallocated page count.

Parameters
[in]preallocatedPageCountThe preallocated page count. The preallocated page count must be between 0 and 65535, inclusive.
Description
Preallocated page count defaults to zero.
Snippet
// If SetPreallocatedPageCount() fails.
if ((status = btrieveFileAttributes.SetPreallocatedPageCount(64 * 1024 - 1)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileAttributes::SetPreallocatedPageCount():%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:
bfileattributes.cpp.

◆ SetRecordCompressionMode()

Btrieve::StatusCode BtrieveFileAttributes::SetRecordCompressionMode ( Btrieve::RecordCompressionMode  recordCompressionMode)

Set record compression mode.

Parameters
[in]recordCompressionModeThe record compression mode.
Description
Record compression defaults to Btrieve::RECORD_COMPRESSION_MODE_NONE. Compression mode blank truncation requires variable length records be enabled.
Snippet
// If SetRecordCompressionMode() fails.
{
printf("Error: BtrieveFileAttributes::SetRecordCompressionMode():%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:
bfileattributes.cpp.

◆ SetReservedDuplicatePointerCount()

Btrieve::StatusCode BtrieveFileAttributes::SetReservedDuplicatePointerCount ( int  reservedDuplicatePointerCount)

Set the reserved duplicate pointer count.

Parameters
[in]reservedDuplicatePointerCountThe reserved duplicate pointer count. The reserved duplicate pointer count must be between 0 and 119, inclusive.
Description
Reserved duplicate pointer count defaults to zero. The maximum reserved duplicate pointer count may be less than 119 depending on file version and page size. For example, a file version of Btrieve::FILE_VERSION_9_0 and page size of Btrieve::PAGE_SIZE_3584 allows for a maximum reserved duplicate pointer count of 54.
Snippet
// If SetReservedDuplicatePointerCount() fails.
if ((status = btrieveFileAttributes.SetReservedDuplicatePointerCount(119)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileAttributes::SetReservedDuplicatePointerCount():%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:
bfileattributes.cpp.

◆ SetSystemDataMode()

Btrieve::StatusCode BtrieveFileAttributes::SetSystemDataMode ( Btrieve::SystemDataMode  systemDataMode)

Set the system data mode.

Parameters
[in]systemDataModeThe system data mode.
Description
System data mode defaults to Btrieve::SYSTEM_DATA_MODE_DEFAULT.
Snippet
// If SetSystemDataMode() fails.
{
printf("Error: BtrieveFileAttributes::SetSystemDataMode():%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:
bfileattributes.cpp.

◆ SetVariableLengthRecordsMode()

Btrieve::StatusCode BtrieveFileAttributes::SetVariableLengthRecordsMode ( Btrieve::VariableLengthRecordsMode  variableLengthRecordsMode)

Set the variable length records mode.

Parameters
[in]variableLengthRecordsModeThe variable length records mode.
Description
Variable length records mode defaults to Btrieve::VARIABLE_LENGTH_RECORDS_MODE_NO.
Snippet
// If SetVariableLengthRecordsMode() fails.
{
printf("Error: BtrieveFileAttributes::SetVariableLengthRecordsMode():%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:
bfileattributes.cpp, btestappend.cpp, btestchunk.cpp, and btestvlr.cpp.