summaryrefslogtreecommitdiff
path: root/src/T2DLL/CFilePluginList.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-14 00:50:34 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-14 00:50:34 +0100
commit37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch)
treeeaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/CFilePluginList.cpp
downloadt2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz
t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip
initial commit
Diffstat (limited to '')
-rw-r--r--src/T2DLL/CFilePluginList.cpp49
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;
+}