Functions | |
int | ksInit (KeySet *ks) |
int | ksClose (KeySet *ks) |
size_t | ksGetSize (KeySet *ks) |
Key * | ksNext (KeySet *ks) |
int | ksRewind (KeySet *ks) |
Key * | ksCurrent (const KeySet *ks) |
size_t | ksInsert (KeySet *ks, Key *toInsert) |
size_t | ksInsertKeys (KeySet *ks, KeySet *toInsert) |
size_t | ksAppend (KeySet *ks, Key *toAppend) |
size_t | ksAppendKeys (KeySet *ks, KeySet *toAppend) |
int | ksCompare (KeySet *ks1, KeySet *ks2, KeySet *removed) |
size_t | ksToStream (const KeySet *ks, FILE *stream, unsigned long options) |
These are the methods to make various manipulations in the objects of class KeySet. Methods for sorting, merging, comparing, and internal cursor manipulation are provided. To use it:
#include <kdb.h>
|
Append a new Key to the end of the KeySet. You should not append Keys that are local variables to a KeySet, only dinamycally allocated ones, due to the future ksClose() you'll call on the KeySet. The KeySet internal cursor is not moved. Do not ksAppend() Keys that are already members of other KeySets.
Definition at line 2408 of file key.c. Referenced by commandEdit(), commandList(), kdbGetChildKeys(), kdbGetRootKeys(), and ksCompare(). |
|
Transfers an entire KeySet to the end of the KeySet. After this call, the toAppend KeySet will be empty.
Definition at line 2431 of file key.c. Referenced by commandList(), kdbGetChildKeys(), and ksCompare(). |
|
KeySet destructor. Will cause keyClose() destructor to be called for all contained keys, and then frees the key object. This is why you should not ksAppend() or ksInsert() a Key that is a local variable, only dinamycally allocated Keys.
After this call,
Definition at line 2253 of file key.c. References keyClose(). Referenced by commandList(). |
|
Compare 2 KeySets with the following behavior:
In the end, After ksCompare(), you should:
Definition at line 2483 of file key.c. References KEY_FLAG_HASDOMAIN, KEY_FLAG_HASKEY, keyClose(), keyCompare(), ksAppend(), and ksAppendKeys(). Referenced by commandEdit(). |
|
Return the current Key
Definition at line 2328 of file key.c. Referenced by commandEdit(), commandImport(), kdbMonitorKeys(), and kdbSetKeys(). |
|
|
|
KeySet object constructor. Every KeySet object that will be used must be initialized first, to setup pointers, counters, etc. Definition at line 2231 of file key.c. Referenced by commandEdit(), commandImport(), commandList(), and kdbGetChildKeys(). |
|
Insert a new Key in the begining of the KeySet. A reference to key will be stored, and not a copy of the key. So a future ksClose() on Do not ksInsert() Keys that are already members of other KeySets.
Definition at line 2352 of file key.c. Referenced by kdbGetRootKeys(). |
|
Transfers an entire KeySet to the begining of the KeySet.
After this call, the
|
|
Returns the next Key in a KeySet. KeySets have an internal cursor that can be reset with ksRewind(). Every time ksNext() is called the cursor is incremented and the new current Key is returned. You'll get a NULL pointer if the end of KeySet was reached. After that, if ksNext() is called again, it will set the cursor to the begining of the KeySet and the first key is returned.
Definition at line 2294 of file key.c. Referenced by commandEdit(), commandList(), kdbMonitorKeys(), and kdbSetKeys(). |
|
Resets a KeySet internal cursor. Use it to set the cursor to the begining of the KeySet
Definition at line 2313 of file key.c. Referenced by commandEdit(), commandImport(), and commandList(). |
|
Prints an XML version of a KeySet object. Accepted options:
Definition at line 2581 of file key.c. References KDB_O_XMLHEADERS, and keyToStream(). Referenced by commandEdit(), and commandList(). |