KSet Class Reference
#include <kset.h>
List of all members.
Detailed Description
Class to manipulate set.
Definition at line 57 of file kset.h.
|
Constructors and Destructor
|
|
KSet (int
pItemPerBlock=KFBX_ITEM_PER_BLOCK) |
|
Int constructor.
|
|
KSet (const
KSet &other) |
|
Copy constructor.
|
|
~KSet () |
|
Destructor.
|
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.
|
Member Enumeration Documentation
- Enumerator:
-
KFBX_NOT_FOUND |
|
KFBX_ITEM_PER_BLOCK |
|
Definition at line 59 of file kset.h.
Constructor & Destructor Documentation
KSet |
( |
int |
pItemPerBlock =
KFBX_ITEM_PER_BLOCK |
) |
|
Int constructor.
- Parameters:
-
|
pItemPerBlock |
The number of items that every block included |
Copy constructor.
- Parameters:
-
Member Function Documentation
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.
- Parameters:
-
|
pReference |
The value of Reference in new item, also is the character for
matching. |
|
pItem |
The value of Item in new item. |
- Returns:
- If add successfully return true,otherwise return false.
Remove the first matching item, whose reference is the same as
given.
- Parameters:
-
|
pReference |
The given reference. |
- Returns:
- If remove successfully return true,otherwise return false.
Remove all the matching item, whose item is the same as
given.
- Parameters:
-
- Returns:
- If remove successfully return true,otherwise return false.
Set first matching item with the given parameter.
- Parameters:
-
|
pReference |
The character for matching. |
|
pItem |
The value of Item that the matching item will be set. |
- Returns:
- If set successfully return true,otherwise return false.
Get first matching item with the given parameter.
- Parameters:
-
|
pReference |
The character for matching. |
|
pIndex |
The pointer to the index of the matching item. |
- Returns:
- The value of Item in the matching item.
Get the item of the given index.
- Parameters:
-
|
pIndex |
The index for matching. |
|
pReference |
The pointer to the Reference of the matching item. |
- Returns:
- The value of Item in the matching item.
bool RemoveFromIndex |
( |
int |
pIndex |
) |
|
Remove the item of the given index.
- Parameters:
-
- Returns:
- If remove successfully return true,otherwise return false.
int
GetCount |
( |
|
) |
const [inline] |
Get number of items in the array.
- Returns:
- The number of items in the array.
Definition at line 143 of file kset.h.
Swap the value of Reference and Item in every item of array, and
sort the new array with the value of Reference.
- Returns:
- If swap successfully return true,otherwise return false.
Sort the array according the value of Reference in each
item.
- Returns:
- If sort successfully return true,otherwise return false.