EbSearch

EbSearch is a client-level module that provides single field based search functions.

[ ebase_lib | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index


Class Summary

class EbSearch
{
public:
Unnamed_Enum UEnum_ebsearch_h_1;
static EbInt32 SearchString(Ebase *ebase, const char *fieldName, const char *string, EbUint32 flag , EbUint32 startOffset , EbUint32 iid );
static EbInt32 SearchNumber(Ebase *ebase, const char *fieldName, EbInt32 number, EbUint32 flags , EbUint32 startOffset , EbUint32 iid );
protected:
}; // EbSearch

Back to the top of EbSearch


Unnamed_Enum UEnum_ebsearch_h_1;

Search options.

    enum {
        CASE = 0,
        NO_CASE = 1,
        CASE_MASK = 1,

Back to the top of EbSearch


EbInt32 SearchString(Ebase *ebase, const char *fieldName, const char *string, EbUint32 flag , EbUint32 startOffset , EbUint32 iid );

Search for a string in a string field.

If the search is backward, and startOffset is bigger than the number of records, startOffset is adjusted to be the last record offset.

Valid search flags include :

                CASE            (default) case-sensitive
                NO_CASE         case-insensitive

                EXACT_MATCH     (default) exact match
                PREFIX_MATCH    search for prefix match
                SUFFIX_MATCH    search for suffix match
                SUBSTRING_MATCH search for substring

                NORMAL          (default) normal
                NEGATIVE        treat "match" as "not match"; vice versa.

                FORWARD         (deafult) search forward
                BACKWARD        search backward
        

Flags from different groups can be combined together through '|' operator.

Parameters :

in iid
Index id according to whose sorting order the search is performed.
in fieldName
The field to be searched.
in startOffset
The first record to be search.
in string
The string to be searched for. It cannot be a NULL pointer.
in flag
How the string should be search.

Return value : The offset of the matching record. Or < 0, if not found.

Exceptoins :

EBE_DATABASE_NOT_OPEN
EBE_INVALID_INDEX
iid out of range
EBE_INVALID_FIELD
cannot find the field
EBE_FIELD_TYPE_MISMATCH
EBE_OUT_OF_MEMORY

    static EbInt32 SearchString(Ebase *ebase,
                                const char *fieldName,
                                const char *string,
                                EbUint32 flag=0,
                                EbUint32 startOffset=0,
                                EbUint32 iid=0);

Back to the top of EbSearch


EbInt32 SearchNumber(Ebase *ebase, const char *fieldName, EbInt32 number, EbUint32 flags , EbUint32 startOffset , EbUint32 iid );

Search for a number in a number field.

If the search is backward, and startOffset is bigger than the number of records, startOffset is set to the last record.

Valid search flags include :

                EQAUL_TO      (default) equal
                LESS_THAN     search for less-than
                GREATER_THAN  search for greater-than

            SINGED      (default) numbers are signed
            UNSINGED    

                NORMAL   (default) normal
                NEGATIVE treat "match" as "not match"; vice versa.

            FORWARD   (deafult) search forward
            BACKWARD   search backward
        

Parameters :

in iid
Index id according to whose sorting order the search is performed.
in fieldName
The field to be searched.
in number
The the number to be searched for.
in flags
The search flags.

Return value : The offset of the matching record. Or < 0 if not found.

Exceptoins : Those which are returned by GetRecord(), GetFieldInt32().

    static EbInt32 SearchNumber(Ebase *ebase,
                                const char *fieldName,
                                EbInt32 number,
                                EbUint32 flags=0,
                                EbUint32 startOffset=0,
                                EbUint32 iid=0);

Back to the top of EbSearch


All Members

public:
Unnamed_Enum UEnum_ebsearch_h_1;
static EbInt32 SearchString(Ebase *ebase, const char *fieldName, const char *string, EbUint32 flag , EbUint32 startOffset , EbUint32 iid );
static EbInt32 SearchNumber(Ebase *ebase, const char *fieldName, EbInt32 number, EbUint32 flags , EbUint32 startOffset , EbUint32 iid );
protected:

Back to the top of EbSearch


Ancestors

Class does not inherit from any other class.

Back to the top of EbSearch


Descendants

Class is not inherited by any others.

Back to the top of EbSearch


Generated from source by the Cocoon utilities on Tue Aug 14 12:00:07 2001 .

Report problems to jkotula@vitalimages.com