From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/CFilePluginList.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/T2DLL/CFilePluginList.cpp (limited to 'src/T2DLL/CFilePluginList.cpp') 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; +} -- cgit v1.2.3