Tools.h++ Manual

21-46 104011 Tandem Computers Incorporated
21
The function
yourApplyFunction
cannot change the key. The value x can be
anything and is passed through from the call to
applyToKeyAndValue()
. A
possible exception that could occur is
RWFileErr
.
void clear();
Removes all items from the collection. A possible exception that could occur is
RWFileErr
.
RWBoolean contains(const char* ky) const;
Returns
TRUE
if the tree contains a key that is equal to the string pointed to by
ky, FALSE
otherwise. A possible exception that could occur is
RWFileErr
.
size_t entries();
Returns the number of items in the
RWBTreeOnDisk
. A possible exception that
could occur is
RWFileErr
.
RWstoredValue findValue(const char* ky);
Returns the value for the key that compares equal to the string pointed to by
ky
. Returns
RWNIL
if no key is found. A possible exception that could occur is
RWFileErr
.
int height();
Returns the height of the
RWBTreeOnDisk
. A possible exception that could
occur is
RWFileErr
.
int insertKeyAndValue(const char*
ky, RWstoredValue v);
Adds a key-value pair to the
B-Tree
. Returns
TRUE
for successful insertion,
FALSE
otherwise. A possible exception that could occur is
RWFileErr
.
RWBoolean isEmpty() const;
Returns
TRUE
if the
RWBTreeOnDisk
is empty, otherwise
FALSE
.
void remove(const char* ky);
Removes the key and value pair that has a key which matches
ky
. A possible
exception that could occur is
RWFileErr
.
RWoffset rootLocation() const;
Returns the offset of the root node.
RWdiskTreeCompare setComparison(RWdiskTreeCompare
fun);
Changes the comparison function to
fun
and returns the old function. This
function must have prototype: