Btrieve 2
Loading...
Searching...
No Matches
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.
 
Btrieve::StatusCode SetFileVersion (Btrieve::FileVersion fileVersion)
 Set the file version.
 
Btrieve::StatusCode SetFixedRecordLength (int fixedRecordLength)
 Set the fixed record length.
 
Btrieve::StatusCode SetFreeSpaceThreshold (Btrieve::FreeSpaceThreshold freeSpaceThreshold)
 Set the free space threshold.
 
Btrieve::StatusCode SetKeyOnly (bool enableKeyOnly)
 Set key only.
 
Btrieve::StatusCode SetPageSize (Btrieve::PageSize pageSize, bool enablePageCompression=false)
 Set the page size.
 
Btrieve::StatusCode SetPreallocatedPageCount (int preallocatedPageCount)
 Set the preallocated page count.
 
Btrieve::StatusCode SetRecordCompressionMode (Btrieve::RecordCompressionMode recordCompressionMode)
 Set record compression mode.
 
Btrieve::StatusCode SetReservedDuplicatePointerCount (int reservedDuplicatePointerCount)
 Set the reserved duplicate pointer count.
 
Btrieve::StatusCode SetSystemDataMode (Btrieve::SystemDataMode systemDataMode)
 Set the system data mode.
 
Btrieve::StatusCode SetVariableLengthRecordsMode (Btrieve::VariableLengthRecordsMode variableLengthRecordsMode)
 Set the variable length records mode.
 

Detailed Description

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
C++ bfileattributes.cpp
// 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;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetBalancedIndexes(True)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetBalancedIndexes():%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.

◆ 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
C++ bfileattributes.cpp
// If SetFileVersion() fails.
{
printf("Error: BtrieveFileAttributes::SetFileVersion():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetFileVersion(btrievePython.Btrieve.FILE_VERSION_9_5)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetFileVersion():%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.

◆ 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::SetFixedRecordLength():%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
Test_BTRV2.cpp, bfileattributes.cpp, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, btestappend.cpp, btestbulk.cpp, btestchunk.cpp, and btestvlr.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
C++ bfileattributes.cpp
// If SetFreeSpaceThreshold() fails.
{
printf("Error: BtrieveFileAttributes::SetFreeSpaceThreshold():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetFreeSpaceThreshold(btrievePython.Btrieve.FREE_SPACE_THRESHOLD_10_PERCENT)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetFreeSpaceThreshold():%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.

◆ 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
C++ bkeyonly.cpp
// 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;
}
Python bkeyonly.py
rc = btrieveFileAttributes.SetKeyOnly(True)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetKeyOnly():%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
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
C++ bfileattributes.cpp
// 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;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetPageSize(btrievePython.Btrieve.PAGE_SIZE_16384)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetPageSize():%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.

◆ 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
C++ bfileattributes.cpp
// 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;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetPreallocatedPageCount(64 * 1024 - 1)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetPreallocatedPageCount():%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.

◆ 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
C++ bfileattributes.cpp
// If SetRecordCompressionMode() fails.
{
printf("Error: BtrieveFileAttributes::SetRecordCompressionMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetRecordCompressionMode(btrievePython.Btrieve.RECORD_COMPRESSION_MODE_RUN_LENGTH_ENCODING)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetRecordCompressionMode():%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.

◆ 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
C++ bfileattributes.cpp
// 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;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetReservedDuplicatePointerCount(119)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetReservedDuplicatePointerCount():%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.

◆ 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
C++ bfileattributes.cpp
// If SetSystemDataMode() fails.
{
printf("Error: BtrieveFileAttributes::SetSystemDataMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetSystemDataMode(btrievePython.Btrieve.SYSTEM_DATA_MODE_NO)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetSystemDataMode():%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.

◆ 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
C++ bfileattributes.cpp
// If SetVariableLengthRecordsMode() fails.
{
printf("Error: BtrieveFileAttributes::SetVariableLengthRecordsMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bfileattributes.py
rc = btrieveFileAttributes.SetVariableLengthRecordsMode(btrievePython.Btrieve.VARIABLE_LENGTH_RECORDS_MODE_YES_VARIABLE_ALLOCATION_TAILS)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileAttributes::SetVariableLengthRecordsMode():%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, btestappend.cpp, btestchunk.cpp, and btestvlr.cpp.