#include <kset.h>
Public Types |
|
enum | { KFBX_NOT_FOUND = 0x0L, KFBX_ITEM_PER_BLOCK = 20 } |
Public Member Functions |
|
bool | Add (kReference pReference, kReference pItem) |
If can't find the matching item,append a
item at the end of the array. |
|
bool | Remove (kReference pReference) |
Remove the first matching item, whose
reference is the same as given. |
|
bool | RemoveItem (kReference pItem) |
Remove all the matching item, whose item is
the same as given. |
|
bool | SetItem (kReference pReference, kReference pItem) |
Set first matching item with the given
parameter. |
|
kReference | Get (kReference pReference, int *pIndex=NULL) const |
Get first matching item with the given
parameter. |
|
void | Clear () |
Delete the array. |
|
kReference | GetFromIndex (int pIndex, kReference *pReference=NULL) const |
Get the item of the given index. |
|
bool | RemoveFromIndex (int pIndex) |
Remove the item of the given index. |
|
int | GetCount () const |
Get number of items in the array. |
|
bool | Swap () const |
Swap the value of Reference and Item in
every item of array, and sort the new array with the value of
Reference. |
|
bool | Sort () const |
Sort the array according the value of
Reference in each item. |
|
const KSet & | operator= (const KSet &) |
KString assignment
operator. |
|
Constructors and Destructor |
|
KSet (int pItemPerBlock=KFBX_ITEM_PER_BLOCK) | |
Int constructor. |
|
KSet (const KSet &other) | |
Copy constructor. |
|
~KSet () | |
Destructor. |
anonymous enum |
Definition at line 59 of file kset.h.
{ KFBX_NOT_FOUND = 0x0L, KFBX_ITEM_PER_BLOCK = 20 };
KSet | ( | int | pItemPerBlock =
KFBX_ITEM_PER_BLOCK |
) |
Int constructor.
pItemPerBlock | The number of items that every block included |
~KSet | ( | ) |
Destructor.
bool Add | ( | kReference | pReference, |
kReference | pItem | ||
) |
If can't find the matching item,append a item at the end of the array.
If find the matching item ,insert the new item before the matching item.
pReference | The value of Reference in new item, also is the character for matching. |
pItem | The value of Item in new item. |
bool Remove | ( | kReference | pReference | ) |
Remove the first matching item, whose reference is the same as given.
pReference | The given reference. |
bool RemoveItem | ( | kReference | pItem | ) |
Remove all the matching item, whose item is the same as given.
pItem | The given item. |
bool SetItem | ( | kReference | pReference, |
kReference | pItem | ||
) |
Set first matching item with the given parameter.
pReference | The character for matching. |
pItem | The value of Item that the matching item will be set. |
kReference Get | ( | kReference | pReference, |
int * | pIndex =
NULL |
||
) | const |
Get first matching item with the given parameter.
pReference | The character for matching. |
pIndex | The pointer to the index of the matching item. |
void Clear | ( | ) |
Delete the array.
kReference GetFromIndex | ( | int | pIndex, |
kReference * | pReference =
NULL |
||
) | const |
Get the item of the given index.
pIndex | The index for matching. |
pReference | The pointer to the Reference of the matching item. |
bool RemoveFromIndex | ( | int | pIndex | ) |
Remove the item of the given index.
pIndex | The given index. |
int GetCount | ( | ) | const [inline] |
bool Swap | ( | ) | const |
Swap the value of Reference and Item in every item of array, and sort the new array with the value of Reference.
bool Sort | ( | ) | const |
Sort the array according the value of Reference in each item.