#include "StdAfx.h" #include "CFilePlugin.h" #include "CFilePluginDB.h" #include "CFilePluginList.h" CFilePluginDB::CFilePluginDB() : LArray(sizeof(CFilePlugin *)) { } /*virtual*/ CFilePluginDB::~CFilePluginDB() { } /*virtual*/ void CFilePluginDB::Add(CFilePlugin* plugin) { LArrayIterator iter(*this); BOOL added = false; CFilePluginList *list; while (!added && iter.Next(&list)) { if (list->GetPluginType() == plugin->GetType()) { list->Add(plugin); added = true; } } if (!added) { list = new CFilePluginList(plugin->GetType()); list->Add(plugin); InsertItemsAt(1, mItemCount + 1, &list); } } /*virtual*/ CFilePluginList* CFilePluginDB::GetFilePluginList(DWORD pluginType) { LArrayIterator iter(*this); CFilePluginList *list; while (iter.Next(&list)) { if (list->GetPluginType() == pluginType) return list; } return NULL; }