Functions



DSList

	public:

DSList();

Creates a new empty List.


append

	public:

void append(DSListElement * node);

Appends the specified ListElement to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameters

NameDescription
nodeSpecifies the new element. This is not copied, and is inserted directly into the list.

append

	public:

void append(char* Key, void* Data, int cleanup=0);

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameters

NameDescription
KeySpecifies the key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
DataSpecifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

append

	public:

void append(unsigned int Key, void* Data, int cleanup=0);

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameters

NameDescription
KeySpecifies the numeric key of the new value.
DataSpecifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

append

	public:

void append(char* Key, unsigned int Data, int cleanup=0);

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameters

NameDescription
KeySpecifies the key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
DataSpecifies the numeric data of the new value.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

append

	public:

void append(unsigned int Key, unsigned int Data, int cleanup=0);

Appends the specified key/value to the end of the list, as opposed to insert, which inserts it at the top of the list.

Parameters

NameDescription
KeySpecifies the numeric key of the new value.
DataSpecifies the numeric data of the new value.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags. In this call, as both values are numeric, this parameter has no effect. but is retained for consistency.

close

	public:

void close();

Removes all the elements from the list, and destroys data in accordance with the cleanup flags of each element. The List remains available for use.


delElement

	public:

void delElement(DSListElement* ele);

Removes the specified element from the List.

Parameters

NameDescription
elePoints to a ListElement which is to be removed from the list. Its data will be dealt with according to its cleanup flags.

delHead

	public:

void delHead();

Removes the first element from the List.


delItem

	public:

void delItem(unsigned int Key);

Removes elements with the specified Key from the List.

Parameters

NameDescription
KeySpecifies a numeric key corresponding to the items to be removed. Its data will be dealt with according to its cleanup flags.

delItem

	public:

void delItem(const char* Key);

Removes elements with the specified Key from the List.

Parameters

NameDescription
KeySpecifies a string key corresponding to the items to be removed. Its data will be dealt with according to its cleanup flags.

delTail

	public:

void delTail();

Removes the last element from the List.


getElement

	public:

DSListElement* getElement(unsigned int Key);

Retrieves an element from the list with the specified Key.

Parameters

NameDescription
KeyA numeric key corresponding to the desired element.
Result: A pointer to the requested ListElement in the list, or NULL if the element was not found.

getElement

	public:

DSListElement* getElement(const char* Key);

Retrieves an element from the list with the specified Key.

Parameters

NameDescription
KeyA string key corresponding to the desired element.
Result: A pointer to the requested ListElement in the list, or NULL if the element was not found.

getHead

	public:

DSListElement* getHead();

Retrieves the first element in the List.

Result: A pointer to the first ListElement in the list, or NULL if there are no elements in the list.

getNumericValue

	public:

unsigned int getNumericValue(const char* Key);

Retrieves the value of an element from the list with the specified Key.

Parameters

NameDescription
KeyA string key corresponding to the desired value.
Result: The requested value in the list, or 0 if the element was not found.

getNumericValue

	public:

unsigned int getNumericValue(unsigned int Key);

Retrieves the value of an element from the list with the specified Key.

Parameters

NameDescription
KeyA numeric key corresponding to the desired value.
Result: The requested value in the list, or 0 if the element was not found.

getPtrValue

	public:

void* getPtrValue(const char* Key);

Retrieves the value of an element from the list with the specified Key.

Parameters

NameDescription
KeyA string key corresponding to the desired value.
Result: A pointer to the requested value in the list, or NULL if the element was not found.

getPtrValue

	public:

void* getPtrValue(unsigned int Key);

Retrieves the value of an element from the list with the specified Key.

Parameters

NameDescription
KeyA numeric key corresponding to the desired value.
Result: A pointer to the requested value in the list, or NULL if the element was not found.

getTail

	public:

DSListElement* getTail();

Retrieves the last element in the List.

Result: A pointer to the last ListElement in the list, or NULL if there are no elements in the list.

inSort

	public:

void inSort(char* Key, void* Data, int cleanup=0);

Inserts the specified key/value to the list maintaining ascending order.

Parameters

NameDescription
KeySpecifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
DataSpecifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

inSort

	public:

void inSort(unsigned int Key, void* Data, int cleanup=0);

Inserts the specified key/value to the list, maintaining ascending order.

Parameters

NameDescription
KeySpecifies the numeric key of the new value.
DataSpecifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

inSort

	public:

void inSort(char* Key, unsigned int Data, int cleanup=0);

Inserts the specified key/value to the list, maintaining ascending order.

Parameters

NameDescription
KeySpecifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
DataSpecifies the numeric data of the new value.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

inSort

	public:

void inSort(unsigned int Key, unsigned int Data, int cleanup=0);

Inserts the specified key/value to the list, maintaining ascending order.

Parameters

NameDescription
KeySpecifies the numeric key of the new value.
DataSpecifies the numeric data of the new value.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

init

	public:

void init();

Creates a new linked list where the constructor can't be used, ie., after allocating a List using malloc. This should not be used in any other case, and the use of malloc is strongly discouraged in favor of new.


insert

	public:

void insert(DSListElement * node);

Inserts the specified ListElement to the head of the list.

Parameters

NameDescription
nodeSpecifies the new ListElement. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.

insert

	public:

void insert(char* Key, void* Data, int cleanup=0);

Inserts the specified key/value to the head of the list.

Parameters

NameDescription
KeySpecifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
DataSpecifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

insert

	public:

void insert(unsigned int Key, void* Data, int cleanup=0);

Inserts the specified key/value to the head of the list.

Parameters

NameDescription
KeySpecifies the numeric key of the new value.
DataSpecifies the data of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

insert

	public:

void insert(char* Key, unsigned int Data, int cleanup=0);

Inserts the specified key/value to the head of the list.

Parameters

NameDescription
KeySpecifies the string key of the new value. Remember, this data is not copied, but the pointer is used directly. You should copy your own data if it isn't constant.
DataSpecifies the numeric data of the new value.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

insert

	public:

void insert(unsigned int Key, unsigned int Data, int cleanup=0);

Inserts the specified key/value to the head of the list.

Parameters

NameDescription
KeySpecifies the numeric key of the new value.
DataSpecifies the numeric data of the new value.
cleanupSpecifies the bitwise combination of flags used to clean up data. See the ListElement class for a list of permissable flags.

occurenceCount

	public:

unsigned int occurenceCount(const char* Key);

Returns the number of occurences of the specified Key there are in the list.

Parameters

NameDescription
Specifiesthe Key that needs counting.
Result: The number of entries of the specified Key in the list.

setKeyValue

	public:

BOOL setKeyValue(const char* Key, char * data);

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA string key corresponding to the desired value.
dataA pointer to the new key string.
Result: Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setKeyValue

	public:

BOOL setKeyValue(const char* Key, unsigned int data);

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA string key corresponding to the desired value.
dataThe new numeric key.
Result: Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setKeyValue

	public:

BOOL setKeyValue(unsigned int Key, char * data);

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA numeric key corresponding to the desired value.
dataA pointer to the new key string.
Result: Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setKeyValue

	public:

BOOL setKeyValue(unsigned int Key, unsigned int data);

Changes the value of the key represented in the list by the specified key. The previous key is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA numeric key corresponding to the desired value.
dataThe new numeric key.
Result: Returns TRUE if the data was successfully changed, or FALSE of the element could not be found.

setValue

	public:

BOOL setValue(const char* Key, void * data);

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA string key corresponding to the desired value.
dataA pointer to the new data.
Result: Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

setValue

	public:

BOOL setValue(const char* Key, unsigned int data);

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA string key corresponding to the desired value.
dataA numeric value of the new data.
Result: Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

setValue

	public:

BOOL setValue(unsigned int Key, void * data);

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA numeric key corresponding to the desired value.
dataA pointer to the new data.
Result: Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

setValue

	public:

BOOL setValue(unsigned int Key, unsigned int data);

Changes the value of the data represented in the list by the specified key. Any previous data is destroyed. The cleanup value governing the ListElement remains unaffected by the use of this call.

Parameters

NameDescription
KeyA numeric key corresponding to the desired value.
dataA numeric value of the new data.
Result: Returns TRUE if the value were successfully changed, or FALSE of the element could not be found.

sortAsNumeric

	public:

BOOL sortAsNumeric(BOOL bDescend=FALSE);

Sorts the linked list by numeric key.

Parameters

NameDescription
bDescendIf TRUE, sort in descending order; if FALSE or omitted, sort in ascending order.
Result: Returns TRUE if the data was successfully sorted, or FALSE if an error occurred.

sortAsString

	public:

BOOL sortAsString(BOOL bDescend=FALSE);

Sorts the linked list by string key.

Parameters

NameDescription
bDescendIf TRUE, sort in descending order; if FALSE or omitted, sort in ascending order.
Result: Returns TRUE if the data was successfully sorted, or FALSE if an error occurred.

~List

	public:

~DSList();

Destroys a List.


Generated with HeaderDoc - © 2000 Apple Computer, Inc. — (Last Updated 9/29/2003)