diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/CFilePluginList.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/T2DLL/CFilePluginList.cpp b/src/T2DLL/CFilePluginList.cpp new file mode 100644 index 0000000..d55a841 --- /dev/null +++ b/src/T2DLL/CFilePluginList.cpp @@ -0,0 +1,49 @@ +#include "CFilePlugin.h" +#include "CFilePluginList.h" + +CFilePluginList::CFilePluginList(DWORD pluginType) { + mPluginType = pluginType; +} + +/*virtual*/ CFilePluginList::~CFilePluginList() { +} + +/*virtual*/ void CFilePluginList::AllClear() { + RemoveAll(); +} + +/*virtual*/ BOOL CFilePluginList::Add(CFilePlugin* plugin) { + BOOL found = false; + POSITION pos = GetHeadPosition(); + + while (!found && pos) { + CFilePlugin *check = GetNext(pos); + if (check->GetID() == plugin->GetID()) + found = true; + } + + if (!found) + AddTail(plugin); + + return !found; +} + +/*virtual*/ unsigned int CFilePluginList::GetItemCount() { + return GetCount(); +} + +/*virtual*/ CFilePlugin* CFilePluginList::GetItemAt(POSITION pos) { + return GetAt(pos); +} + +CFilePlugin* CFilePluginList::GetItem(DWORD id) { + POSITION pos = GetHeadPosition(); + + while (pos) { + CFilePlugin *check = GetNext(pos); + if (check->GetID() == id) + return check; + } + + return NULL; +} |