Class NameTab
See Also: Class Tab.
class NameTab : public Tab<TCHAR *>
Description:
This class is used to store a table of names. For example, this class is used by lights for their "Inclusion" and "Exclusion" lists. This class maintains an 'include' flag that specifies whether the list of names is things to be included, or things to be excluded. There is no reason the NameTab class can't be used for other things where inclusion/exclusion is not relevant: in that case one can just ignore the 'include' flag. All methods are implemented by the system.
Methods:
Prototype:
NameTab()
Remarks:
Constructor. The 'include' flag is set to FALSE.
Prototype:
void SetFlag(ULONG f, BOOL b=1)
Remarks:
Sets the specified flag to the specified value.
Parameters:
ULONG f
The flag(s) to set. One or more of the following values:
NT_INCLUDE
This bit is used to indicate "Include" mode.
NT_AFFECT_ILLUM
This bit is used to indicate the "Illumination" check box in the exclusion list dialog.
NT_AFFECT_SHADOWCAST
This bit is used to indicate the "Shadow Casting" check box in the exclusion list dialog.
BOOL b=1
The value to set.
Prototype:
BOOL TestFlag(ULONG f)
Remarks:
Returns TRUE if the specified flag(s) are set; otherwise FALSE.
Parameters:
ULONG f
The flag(s) to set. One or more of the following values:
NT_INCLUDE
This bit is used to indicate "Include" mode.
NT_AFFECT_ILLUM
This bit is used to indicate the "Illumination" check box in the exclusion list dialog.
NT_AFFECT_SHADOWCAST
This bit is used to indicate the "Shadow Casting" check box in the exclusion list dialog.
Prototype:
int AddName(TCHAR *n);
Remarks:
Appends the specified name to the end of the list.
Parameters:
TCHAR *n
The name to add.
Return Value:
Returns the number of items in the list prior to appending.
Prototype:
void SetName(int i, TCHAR *n);
Remarks:
Stores the specified name at the specified position in the list.
Parameters:
int i
The position in the list for the name.
TCHAR *n
The name to store. If the name is NULL, the 'i-th' entry is set to NULL.
Prototype:
void SetSize(int num);
Remarks:
Sets the size of the list. If the new size is smaller than the current size entries are deleted.
Parameters:
int num
Specifies the size of the list.
Prototype:
void RemoveName(int i);
Remarks:
Removes the 'i-th' name from the list.
Parameters:
int i
Specifies the index of the name to remove.
Prototype:
int FindName(TCHAR* n);
Remarks:
Returns the index of the name passed; otherwise returns -1.
Parameters:
TCHAR* n
The name to find.
Prototype:
IOResult Load(ILoad *iload);
Remarks:
Loads this NameTab from disk.
Parameters:
ILoad *iload
This class provides methods to load data from disk.
Return Value:
See Also: List of IO Results.
Prototype:
IOResult Save(ISave *isave);
Remarks:
Saves this NameTab to disk.
Parameters:
ISave *isave
This class provides methods to save data to disk.
Return Value:
See Also: List of IO Results.
Operators:
Prototype:
NameTab& operator=(const NameTab& n);
Remarks:
Assignment operator. The specified NameTab is copied to this NameTab.