2 * Copyright 2007, Ingo Weinhold, bonefish@users.sf.net.
3 * Distributed under the terms of the MIT License.
5 #ifndef _DISK_SYSTEM_ADD_ON_MANAGER_H
6 #define _DISK_SYSTEM_ADD_ON_MANAGER_H
8 #include <FindDirectory.h>
13 class BDiskSystemAddOn
;
19 class DiskSystemAddOnManager
{
21 static DiskSystemAddOnManager
* Default();
26 // load/unload all disk system add-ons
27 status_t
LoadDiskSystems();
28 void UnloadDiskSystems();
30 // manager must be locked
31 int32
CountAddOns() const;
32 BDiskSystemAddOn
* AddOnAt(int32 index
) const;
34 // manager will be locked
35 BDiskSystemAddOn
* GetAddOn(const char* name
);
36 void PutAddOn(BDiskSystemAddOn
* addOn
);
43 DiskSystemAddOnManager();
45 static void _InitSingleton();
47 AddOn
* _AddOnAt(int32 index
) const;
48 void _PutAddOn(int32 index
);
50 status_t
_LoadAddOns(StringSet
& alreadyLoaded
,
51 directory_which directory
);
54 mutable BLocker fLock
;
56 BList fAddOnsToBeUnloaded
;
59 static DiskSystemAddOnManager
* sManager
;
63 } // namespace BPrivate
65 using BPrivate::DiskSystemAddOnManager
;
67 #endif // _DISK_SYSTEM_ADD_ON_MANAGER_H