Next: Method of use
Up: NameList
Previous: Internal data structures
- int num(void) - return number of items in the NameList.
- int add_name(char *, const T&) - adds a new name to the
list, with the given data of type T associated with it. This returns the
index (also called typecode) of the name in the list. If the name
already exists in the list, this just returns to index of the existing
name, and does not change the data stored.
- char *name(int) - return the name of the Nth item.
- char *sort_name(int) - return the name of the Nth sorted item,
i.e. the Nth highest name when they are put in sorted order.
- int typecode(char *, int = -1) - return the index for the given
name. If the second argument is greater than 0, it is used as the max
length of the names to check for a match. If it is negative, an exact
match must be found. If no match is found, this returns -1.
- int sort_typecode(int) - return the actual index of the Nth
sorted item.
- T data(char *, int = -1) - return a copy of the data for
the given name, in the same way as for typecode(char *, int).
- T data(int) - return the data for the Nth item.
- void set_data(int, const T&) - changes the data value
associated with the Nth name to the given value.
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999