blob: cf08046378737b8421e4c1f5911a73784b3709d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#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;
}
|