#include <epsclist.h>
Inheritance diagram for EPSCommentList:
Public Member Functions | |
EPSCommentList (void) | |
Creates the class, and sets all the variables to be a default value. | |
~EPSCommentList (void) | |
Destroys the class, and all of its member variables. | |
BOOL | Add (TCHAR *pStart, TCHAR *pEnd, BOOL DoProcessComments, UINT32 NestingDepth) |
Adds a list item to the end of mpCommentList record. | |
const EPSCommentDef & | ReturnElement (INT32 Index) |
Returns a reference to the nth item in the linked list, where n = Index. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (EPSCommentList) | |
Private Attributes | |
EPSCommentDef * | mpCommentList |
INT32 | mListSize |
Definition at line 119 of file epsclist.h.
|
Creates the class, and sets all the variables to be a default value.
Definition at line 117 of file epsclist.cpp. 00118 { 00119 // Set the comment list pointer to be NULL, so as to avoid any problems with adding 00120 // items to it. 00121 mpCommentList = NULL; 00122 mListSize = 0; 00123 }
|
|
Destroys the class, and all of its member variables.
Definition at line 138 of file epsclist.cpp. 00139 { 00140 // Delete the list. This invokes a recursive call to remove all successive items. 00141 delete mpCommentList; 00142 }
|
|
Adds a list item to the end of mpCommentList record.
Definition at line 164 of file epsclist.cpp. 00168 { 00169 // Create a new EPSCommentDef, and assign the appropriate values. 00170 EPSCommentDef *pNewDef = new EPSCommentDef ( pStart, pEnd, DoProcessComments, 00171 NestingDepth ); 00172 00173 // Determine whether something was created. 00174 if ( pNewDef != NULL ) 00175 { 00176 // Add it to the end of the list. 00177 if ( mpCommentList == NULL ) 00178 { 00179 // The pointer is NULL, so just assign the value. 00180 mpCommentList = pNewDef; 00181 } 00182 else 00183 { 00184 // There already is a list, so add this to it. 00185 mpCommentList->Add ( pNewDef ); 00186 } 00187 00188 // Maintain a count of the number of elements in the list. 00189 mListSize ++; 00190 00191 return TRUE; 00192 } 00193 else 00194 { 00195 // Not enough memory. 00196 return FALSE; 00197 } 00198 }
|
|
|
|
Returns a reference to the nth item in the linked list, where n = Index.
Definition at line 212 of file epsclist.cpp. 00213 { 00214 // Set up the local variables. 00215 EPSCommentDef *pItem = mpCommentList; 00216 EPSCommentDef *pNext = NULL; 00217 INT32 Count = 0; 00218 00219 // Ensure that the comment list has been initialised. 00220 ERROR1IF ( pItem == NULL, EmptyDefinition, 00221 "The comment list hasn't been initialised!" ); 00222 00223 // Catch out-of-bounds calls. 00224 if ( Index >= mListSize ) 00225 return EmptyDefinition; 00226 00227 // Loop through the list until there are no more items, or we reach the right index. 00228 while ( pNext = pItem->GetNext (), Count < Index && pNext != NULL ) 00229 { 00230 pItem = pNext; 00231 Count ++; 00232 } 00233 00234 // Return the appropriate list item. 00235 return *pItem; 00236 }
|
|
Definition at line 139 of file epsclist.h. |
|
Definition at line 138 of file epsclist.h. |