#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 found = false; CFilePluginList *list; while (!found && iter.Next(&list)) { if (list->GetPluginType() == plugin->GetType()) { list->Add(plugin); found = true; } } if (!found) { 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; }