#include <plugin.h>
Inheritance diagram for PlugInPathList:
Public Member Functions | |
PlugInPathList () | |
Constructor for the list of pathnames to parse plug-ins for. | |
~PlugInPathList () | |
Destroy the list of pathnames to parse plug-ins for. | |
PlugInPath * | GetFirstPath () |
Finds the first pathname in the list of plug-in pathnames. When searching the pathname list, you MUST use these form of the list classes GetHead/GetNext as otherwise you will get unknown effects. | |
PlugInPath * | GetNextPath (const PlugInPath *pCurrentItem) |
Finds the next pathname in the list of plug-in pathnames. When searching the pathname list, you MUST use these form of the list classes GetHead/GetNext as otherwise you will get unknown effects. | |
PlugInPath * | AddPathName (const PathName &NewPath, BOOL IsHidden=FALSE) |
Add a new pathname to the list of plug-in pathnames. Hidden pathnames are ones not added by the user but are the sub-directories of the user added ones. | |
BOOL | DeletePathName (const PathName &OldPath) |
Delete a pathname from the list of plug-in pathnames. | |
BOOL | RemoveHiddenItems () |
Removes all hidden items, i.e. ones not added by the user, from the list of pathnames. | |
Protected Attributes | |
INT32 | m_IDCounter |
Definition at line 238 of file plugin.h.
|
Constructor for the list of pathnames to parse plug-ins for.
Definition at line 260 of file plugin.cpp. 00261 { 00262 m_IDCounter = 0; 00263 }
|
|
Destroy the list of pathnames to parse plug-ins for.
Definition at line 279 of file plugin.cpp. 00280 { 00281 // Destroy the list of pathnames which we may have 00282 /* PlugInPath* pPath = (PlugInPath *)GetHead(); 00283 while (pPath) 00284 { 00285 delete pPath; 00286 00287 // Try the next pathname in the list 00288 pPath = (PlugInPath *)GetNext(pPath); 00289 } */ 00290 00291 DeleteAll(); 00292 }
|
|
Add a new pathname to the list of plug-in pathnames. Hidden pathnames are ones not added by the user but are the sub-directories of the user added ones.
Definition at line 415 of file plugin.cpp. 00416 { 00417 PlugInPath *pPlugPath = new PlugInPath(NewPath, m_IDCounter, IsHidden); 00418 00419 // Increment our counter which a plug-in uses to associate itself with a pathname 00420 m_IDCounter++; 00421 00422 // Check for out of memory 00423 if (pPlugPath == NULL) 00424 return NULL; 00425 00426 // Add to the list and return success 00427 AddTail(pPlugPath); 00428 return pPlugPath; 00429 }
|
|
Delete a pathname from the list of plug-in pathnames.
Definition at line 444 of file plugin.cpp. 00445 { 00446 String_256 OldPathStr = OldPath.GetPath(); 00447 PlugInPath* pPath = (PlugInPath *)GetHead(); 00448 while (pPath) 00449 { 00450 PathName Path = pPath->GetPathName(); 00451 if (Path.GetPath() == OldPathStr) 00452 { 00453 RemoveItem(pPath); 00454 // remove item returns NULL if problem 00455 if (pPath == NULL) 00456 return FALSE; 00457 delete pPath; 00458 return TRUE; 00459 } 00460 00461 // Try the next pathname in the list 00462 pPath = (PlugInPath *)GetNext(pPath); 00463 } 00464 00465 // Failed to find the path in the list 00466 return FALSE; 00467 }
|
|
Finds the first pathname in the list of plug-in pathnames. When searching the pathname list, you MUST use these form of the list classes GetHead/GetNext as otherwise you will get unknown effects.
Definition at line 308 of file plugin.cpp. 00309 { 00310 // Get the real first item, if there is one 00311 PlugInPath * pPath = (PlugInPath * ) GetHead(); 00312 // While there is an item and it is hidden then search for the next one in the list 00313 while (pPath && pPath->IsHidden()) 00314 { 00315 pPath = (PlugInPath * ) GetNext(pPath); 00316 } 00317 00318 return pPath; 00319 }
|
|
Finds the next pathname in the list of plug-in pathnames. When searching the pathname list, you MUST use these form of the list classes GetHead/GetNext as otherwise you will get unknown effects.
Definition at line 335 of file plugin.cpp. 00336 { 00337 ERROR3IF(pCurrentItem == NULL,"GetNextPath has been given a null current item"); 00338 if (pCurrentItem == NULL) 00339 return NULL; 00340 00341 // Get the real next item, if there is one 00342 PlugInPath * pPath = (PlugInPath * ) GetNext(pCurrentItem); 00343 // While there is an item and it is hidden then search for the next one in the list 00344 while (pPath && pPath->IsHidden()) 00345 { 00346 pPath = (PlugInPath * ) GetNext(pPath); 00347 } 00348 00349 return pPath; 00350 }
|
|
Removes all hidden items, i.e. ones not added by the user, from the list of pathnames.
Definition at line 364 of file plugin.cpp. 00365 { 00366 // Go through all the paths in the list and remove all those with the hidden 00367 // attribute set. 00368 PlugInPath* pPath = (PlugInPath *)GetHead(); 00369 while (pPath) 00370 { 00371 if (pPath->IsHidden()) 00372 { 00373 // The item is hidden so remove it 00374 // First, find the next item, if there is one 00375 PlugInPath* pNextPath = (PlugInPath *)GetNext(pPath); 00376 00377 RemoveItem(pPath); 00378 // remove item returns NULL if problem 00379 if (pPath == NULL) 00380 return FALSE; 00381 00382 // remove the old path item from memory 00383 delete pPath; 00384 // move to considering the next item 00385 pPath = pNextPath; 00386 } 00387 else 00388 { 00389 // Try the next pathname in the list 00390 pPath = (PlugInPath *)GetNext(pPath); 00391 } 00392 } 00393 00394 return TRUE; 00395 }
|
|
|