Public Member Functions | List of all members
BtrieveFilter Class Reference

The Btrieve filter class. More...

#include <btrieveCpp.h>

Public Member Functions

 BtrieveFilter ()
 
 ~BtrieveFilter ()
 
Btrieve::StatusCode SetACSMode (Btrieve::ACSMode ACSMode)
 Set the alternate collation sequence mode. More...
 
Btrieve::StatusCode SetACSName (const char *name)
 Set the alternate collation sequence name. More...
 
Btrieve::StatusCode SetACSUserDefined (const char *name)
 Set the user defined alternate collation sequence name. More...
 
Btrieve::StatusCode SetComparison (Btrieve::Comparison comparison)
 Set the comparison. More...
 
Btrieve::StatusCode SetComparisonConstant (const char *constant, int constantLength)
 Set the comparison constant. More...
 
Btrieve::StatusCode SetComparisonField (int offset)
 Set the comparison field. More...
 
Btrieve::StatusCode SetConnector (Btrieve::Connector connector)
 Set the field connector. More...
 
Btrieve::StatusCode SetField (int offset, int length, Btrieve::DataType dataType)
 Set the field. More...
 
Btrieve::StatusCode SetLikeCodePageName (const char *name)
 Set the code page name to be used for the comparison types Like or Not Like. More...
 

Detailed Description

The Btrieve filter class.

Examples:
bfilter.cpp, and btestbulk.cpp.

Constructor & Destructor Documentation

◆ BtrieveFilter()

BtrieveFilter::BtrieveFilter ( )
Snippet
BtrieveFilter btrieveFilter;

◆ ~BtrieveFilter()

BtrieveFilter::~BtrieveFilter ( )

Member Function Documentation

◆ SetACSMode()

Btrieve::StatusCode BtrieveFilter::SetACSMode ( Btrieve::ACSMode  ACSMode)

Set the alternate collation sequence mode.

Note
This method replaced BtrieveFilter::SetCaseSensitivity in PSQL 13.20.
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 BtrieveFilter::SetACSName or BtrieveFilter::SetACSUserDefined. Btrieve::ACS_MODE_NUMBERED is unsupported.
Snippet
// If SetCaseSensitivity() fails.
{
printf("Error: BtrieveFilter::SetACSMode():%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.

◆ SetACSName()

Btrieve::StatusCode BtrieveFilter::SetACSName ( const char *  name)

Set the alternate collation sequence name.

Parameters
[in]nameThe name.
Description
Filters have no alternate collation sequence name initially. To reference an alternate collation sequence name it must exist in the file. An alternate collation sequence name may be added to a file when an index is created. See BtrieveFile::IndexCreate.
Snippet
// If SetACSName() fails.
if ((status = btrieveFilter.SetACSName("u54-msft_enus_0")) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFilter::SetACSName():%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.

◆ SetACSUserDefined()

Btrieve::StatusCode BtrieveFilter::SetACSUserDefined ( const char *  name)

Set the user defined alternate collation sequence name.

Parameters
[in]nameThe name.
Description
Filters have no user defined alternate collation sequence name initially. To reference a user defined alternate collation sequence it must exist in the file. A user defined alternate collation sequence may be added to a file when an index is created. See BtrieveFile::IndexCreate.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString

◆ SetComparison()

Btrieve::StatusCode BtrieveFilter::SetComparison ( Btrieve::Comparison  comparison)

Set the comparison.

Parameters
[in]comparisonThe comparison.
Description
Comparison defaults to Btrieve::COMPARISON_NONE.
Snippet
// If SetComparison() fails.
{
printf("Error: BtrieveFilter::SetComparison():%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.

◆ SetComparisonConstant()

Btrieve::StatusCode BtrieveFilter::SetComparisonConstant ( const char *  constant,
int  constantLength 
)

Set the comparison constant.

Parameters
[in]constantThe comparison constant.
[in]constantLengthThe comparison constant length. Comparison constant length is limited to Btrieve::MAXIMUM_KEY_LENGTH.
Description
Filters have no comparison constant initially.
Snippet
// If SetComparisonConstant() fails.
if ((status = btrieveFilter.SetComparisonConstant((char *)key, 1)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFilter::SetComparisonConstant():%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.

◆ SetComparisonField()

Btrieve::StatusCode BtrieveFilter::SetComparisonField ( int  offset)

Set the comparison field.

Parameters
[in]offsetThe comparison field offset. Offset must be less than Btrieve::MAXIMUM_RECORD_LENGTH.
Description
Filters have no comparison field initially.
Snippet
// If SetComparisonField() fails.
if ((status = btrieveFilter.SetComparisonField(27)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFilter::SetComparisonField():%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.

◆ SetConnector()

Btrieve::StatusCode BtrieveFilter::SetConnector ( Btrieve::Connector  connector)

Set the field connector.

Parameters
[in]connectorThe connector.
Description
Field connector defaults to Btrieve::CONNECTOR_LAST.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString
Examples:
bfilter.cpp.

◆ SetField()

Btrieve::StatusCode BtrieveFilter::SetField ( int  offset,
int  length,
Btrieve::DataType  dataType 
)

Set the field.

Parameters
[in]offsetThe offset. Offset must be less than Btrieve::MAXIMUM_RECORD_LENGTH.
[in]lengthThe length. Length is limited to Btrieve::MAXIMUM_RECORD_LENGTH.
[in]dataTypeThe data type. Btrieve::DATA_TYPE_LEGACY_BINARY and Btrieve::DATA_TYPE_LEGACY_STRING are not supported.
Description
Filters have no field initially. Offset plus length is limited to Btrieve::MAXIMUM_RECORD_LENGTH.
Snippet
// If SetField() fails.
{
printf("Error: BtrieveFilter::SetField():%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.

◆ SetLikeCodePageName()

Btrieve::StatusCode BtrieveFilter::SetLikeCodePageName ( const char *  name)

Set the code page name to be used for the comparison types Like or Not Like.

Parameters
[in]nameThe name of the code page.
Description
Supply the name of the code page to be used for string comparisons for the Like/Not Like comparisons. The comparison constant and data must use the same code page for accurate comparison.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString