Btrieve 2
Loading...
Searching...
No Matches
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.
 
Btrieve::StatusCode SetACSName (const char *name)
 Set the alternate collation sequence name.
 
Btrieve::StatusCode SetACSUserDefined (const char *name)
 Set the user defined alternate collation sequence name.
 
Btrieve::StatusCode SetComparison (Btrieve::Comparison comparison)
 Set the comparison.
 
Btrieve::StatusCode SetComparisonConstant (const char *constant, int constantLength)
 Set the comparison constant.
 
Btrieve::StatusCode SetComparisonField (int offset)
 Set the comparison field.
 
Btrieve::StatusCode SetConnector (Btrieve::Connector connector)
 Set the field connector.
 
Btrieve::StatusCode SetField (int offset, int length, Btrieve::DataType dataType)
 Set the field.
 
Btrieve::StatusCode SetLikeCodePageName (const char *name)
 Set the code page name to be used for the comparison types Like or Not Like.
 
Btrieve::StatusCode SetSystemField (Btrieve::SystemField systemField)
 Set the system field.
 

Detailed Description

The Btrieve filter class.

Examples
bfilter.cpp, and btestbulk.cpp.

Constructor & Destructor Documentation

◆ BtrieveFilter()

BtrieveFilter::BtrieveFilter ( )
Snippet
C++ btestbulk.cpp
BtrieveFilter btrieveFilter;
Python btestbulk.py
btrieveFilter = btrievePython.BtrieveFilter()
assert(btrieveFilter != None)

◆ ~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 v13 R2.
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
C++ bfilter.cpp
// If SetCaseSensitivity() fails.
{
printf("Error: BtrieveFilter::SetACSMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python bfilter.py
rc = btrieveFilter.SetACSMode(btrievePython.Btrieve.ACS_MODE_CASE_INSENSITIVE)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFilter::SetACSMode():%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.

◆ 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
C++ bfilter.cpp
// 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;
}
Python bfilter.py
rc = btrieveFilter.SetACSName("u54-msft_enus_0")
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFilter::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.

◆ 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
C++ btestbulk.cpp
// If SetComparison() fails.
{
printf("Error: BtrieveFilter::SetComparison():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveFilter.SetComparison(btrievePython.Btrieve.COMPARISON_EQUAL)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFilter::SetComparison():%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 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
C++ btestbulk.cpp
// 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;
}
Python btestbulk.py
rc = btrieveFilter.SetComparisonConstant(key)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFilter::SetComparisonConstant():%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 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
C++ bfilter.cpp
// 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;
}
Python bfilter.py
rc = btrieveFilter.SetComparisonField(27)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFilter::SetComparisonField():%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.

◆ 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
C++ btestbulk.cpp
// If SetField() fails.
{
printf("Error: BtrieveFilter::SetField():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
Python btestbulk.py
rc = btrieveFilter.SetField(0, 1, btrievePython.Btrieve.DATA_TYPE_UNSIGNED_BINARY)
assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFilter::SetField():%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 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

◆ SetSystemField()

Btrieve::StatusCode BtrieveFilter::SetSystemField ( Btrieve::SystemField systemField)

Set the system field.

Parameters
[in]systemFieldThe system field.
Description
Filters have no system field initially.
Return values
= Btrieve::STATUS_CODE_NO_ERRORSuccess.
!= Btrieve::STATUS_CODE_NO_ERRORAn error has occurred.
See also
Btrieve::StatusCodeToString