PlugInPathList Class Reference

Holds a list of Pathnames that the PlugInManager will use to search for plug-ins. The list is set up by the user in the plug-ins options tab. More...

#include <plugin.h>

Inheritance diagram for PlugInPathList:

List CCObject SimpleCCObject List of all members.

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.
PlugInPathGetFirstPath ()
 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.
PlugInPathGetNextPath (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.
PlugInPathAddPathName (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

Detailed Description

Holds a list of Pathnames that the PlugInManager will use to search for plug-ins. The list is set up by the user in the plug-ins options tab.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/96
See also:
PlugInPath;

Definition at line 238 of file plugin.h.


Constructor & Destructor Documentation

PlugInPathList::PlugInPathList  ) 
 

Constructor for the list of pathnames to parse plug-ins for.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/12/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
PlugInPath

Definition at line 260 of file plugin.cpp.

00261 {
00262     m_IDCounter = 0;
00263 }

PlugInPathList::~PlugInPathList  ) 
 

Destroy the list of pathnames to parse plug-ins for.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
PlugInPath

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 }


Member Function Documentation

PlugInPath * PlugInPathList::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.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/96
Parameters:
NewPath - the new pathname to put in the list. [INPUTS] IsHidden - the pathname is not one added by the user (Defaults to FALSE)
Returns:
Pointer to the newly added pathname, or NULL if out of memory => ERROR1

Errors: Out of memory => ERROR1

See also:
PlugInPath

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 }

BOOL PlugInPathList::DeletePathName const PathName OldPath  ) 
 

Delete a pathname from the list of plug-in pathnames.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/96
Parameters:
OldPath - the pathname to delete from the list. [INPUTS]
Returns:
True if deleted ok, False otherwise.
See also:
PlugInPath

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 }

PlugInPath * PlugInPathList::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.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/1/97
Returns:
Pointer to the first PlugInPath or NULL if there are none.
See also:
GetNextPath

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 }

PlugInPath * PlugInPathList::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.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/1/97
Returns:
Pointer to the first PlugInPath or NULL if there are none.
See also:
GetNextPath

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 }

BOOL PlugInPathList::RemoveHiddenItems  ) 
 

Removes all hidden items, i.e. ones not added by the user, from the list of pathnames.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/1/97
Returns:
True if completed succesfully, False otherwise.

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 }


Member Data Documentation

INT32 PlugInPathList::m_IDCounter [protected]
 

Definition at line 257 of file plugin.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:59:48 2007 for Camelot by  doxygen 1.4.4