Btrieve 2
Loading...
Searching...
No Matches
BtrieveIndexAttributes Class Reference

The Btrieve index attributes class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveIndexAttributes ()
 
 ~BtrieveIndexAttributes ()
 
Btrieve::StatusCode AddKeySegment (BtrieveKeySegment *btrieveKeySegment)
 Add a key segment.
 
Btrieve::StatusCode SetACSMode (Btrieve::ACSMode ACSMode)
 Set the alternate collation sequence mode.
 
Btrieve::StatusCode SetACSName (const char *ACSName)
 Set the alternate collation sequence name.
 
Btrieve::StatusCode SetACSNumber (int ACSNumber)
 Set the alternate collation sequence number.
 
Btrieve::StatusCode SetACSUserDefined (const char *ACSName, const char *ACSMap, int ACSMapLength)
 Set the user defined alternate collation sequence.
 
Btrieve::StatusCode SetDuplicateMode (Btrieve::DuplicateMode duplicateMode)
 Set the duplicate mode.
 
Btrieve::StatusCode SetIndex (Btrieve::Index index)
 Set the index.
 
Btrieve::StatusCode SetModifiable (bool enableModifiable)
 Set modifiable.
 

Detailed Description

Constructor & Destructor Documentation

◆ BtrieveIndexAttributes()

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

◆ ~BtrieveIndexAttributes()

BtrieveIndexAttributes::~BtrieveIndexAttributes ( )

Member Function Documentation

◆ AddKeySegment()

Btrieve::StatusCode BtrieveIndexAttributes::AddKeySegment ( BtrieveKeySegment * btrieveKeySegment)

Add a key segment.

Parameters
[in]btrieveKeySegmentThe key segment.
Description
Index attributes have no key segments initially.
Snippet
C++ btest.cpp
// If AddKeySegment() fails.
if ((status = btrieveIndexAttributes.AddKeySegment(&btrieveKeySegment)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveIndexAttributes::AddKeySegment():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btest.py
rc = btrieveIndexAttributes.AddKeySegment(btrieveKeySegment)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveIndexAttributes::AddKeySegment():%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, bfilter.cpp, bindexattributes.cpp, bkeyonly.cpp, block.cpp, bpercentage.cpp, btest.cpp, and btestvlr.cpp.

◆ SetACSMode()

Btrieve::StatusCode BtrieveIndexAttributes::SetACSMode ( Btrieve::ACSMode ACSMode)

Set the alternate collation sequence mode.

Parameters
[in]ACSModeThe alternate collation sequence mode.
Description
Alternate collation sequence mode defaults to Btrieve::ACS_MODE_NONE. To set the alternate collation sequence mode to Btrieve::ACS_MODE_NAMED use BtrieveIndexAttributes::SetACSName or BtrieveIndexAttributes::SetACSUserDefined. To set the alternate collation sequence mode to Btrieve::ACS_MODE_NUMBERED use BtrieveIndexAttributes::SetACSNumber.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ SetACSName()

Btrieve::StatusCode BtrieveIndexAttributes::SetACSName ( const char * ACSName)

Set the alternate collation sequence name.

Note
This method accepts international sort rule and unicode alternate collation sequence names only. Use BtrieveIndexAttributes::SetACSUserDefined to specify a user defined alternate collation sequence.
Parameters
[in]ACSNameThe alternate collation sequence name.
Description
By default there is no alternate collation sequence name. Setting the alternate collation sequence name also sets the alternate collation sequence mode to Btrieve::ACS_MODE_NAMED.
Snippet
C++ bindexattributes.cpp
// If SetACSName() fails.
if ((status = btrieveIndexAttributes.SetACSName("u54-msft_enus_0")) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveIndexAttributes::SetACSName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bindexattributes.py
rc = btrieveIndexAttributes.SetACSName("u54-msft_enus_0")
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveIndexAttributes::SetACSName():%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
bfilter.cpp, and bindexattributes.cpp.

◆ SetACSNumber()

Btrieve::StatusCode BtrieveIndexAttributes::SetACSNumber ( int ACSNumber)

Set the alternate collation sequence number.

Parameters
[in]ACSNumberThe alternate collation sequence number.
Description
By default there is no alternate collation sequence number. Setting the alternate collation sequence number also sets the alternate collation sequence mode to Btrieve::ACS_MODE_NUMBERED.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ SetACSUserDefined()

Btrieve::StatusCode BtrieveIndexAttributes::SetACSUserDefined ( const char * ACSName,
const char * ACSMap,
int ACSMapLength )

Set the user defined alternate collation sequence.

Parameters
[in]ACSNameThe alternate collation sequence name.
[in]ACSMapThe alternate collation sequence map.
[in]ACSMapLengthThe alternate collation sequence map length.
Description
By default there is no user defined alternate collation sequence. Setting the user defined alternate collation sequence also sets the alternate collation sequence mode to Btrieve::ACS_MODE_NAMED.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ SetDuplicateMode()

Btrieve::StatusCode BtrieveIndexAttributes::SetDuplicateMode ( Btrieve::DuplicateMode duplicateMode)

Set the duplicate mode.

Parameters
[in]duplicateModeThe duplicate mode.
Description
Duplicate mode defaults to Btrieve::DUPLICATE_MODE_NOT_ALLOWED.
Snippet
C++ bindexattributes.cpp
// If SetDuplicateMode() fails.
{
printf("Error: BtrieveIndexAttributes::SetDuplicateMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bindexattributes.py
rc = btrieveIndexAttributes.SetDuplicateMode(btrievePython.Btrieve.DUPLICATE_MODE_ALLOWED_NONREPEATING)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveIndexAttributes::SetDuplicateMode():%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
bindexattributes.cpp.

◆ SetIndex()

Btrieve::StatusCode BtrieveIndexAttributes::SetIndex ( Btrieve::Index index)

Set the index.

Parameters
[in]indexThe index.
Description
Index defaults to the first available index starting at Btrieve::INDEX_1.
Snippet
C++ bindexattributes.cpp
// If SetIndex() fails.
if ((status = btrieveIndexAttributes.SetIndex(Btrieve::INDEX_119)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveIndexAttributes::SetIndex():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bindexattributes.py
rc = btrieveIndexAttributes.SetIndex(btrievePython.Btrieve.INDEX_119)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveIndexAttributes::SetIndex():%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
bindexattributes.cpp.

◆ SetModifiable()

Btrieve::StatusCode BtrieveIndexAttributes::SetModifiable ( bool enableModifiable)

Set modifiable.

Parameters
[in]enableModifiableEnable modifiable?
Description
Modifiable is enabled by default.
Snippet
C++ bindexattributes.cpp
// If SetModifiable() fails.
if ((status = btrieveIndexAttributes.SetModifiable(false)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveIndexAttributes::SetModifiable():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bindexattributes.py
rc = btrieveIndexAttributes.SetModifiable(False)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveIndexAttributes::SetModifiable():%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, and bindexattributes.cpp.