2 * Copyright 2014, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef PACKAGE_SUPPORT_H
6 #define PACKAGE_SUPPORT_H
11 #include <Referenceable.h>
12 #include <util/DoublyLinkedList.h>
18 class PackageVolumeState
: public DoublyLinkedListLinkImpl
<PackageVolumeState
> {
21 ~PackageVolumeState();
23 status_t
SetTo(const char* stateName
);
26 const char* Name() const
28 const char* DisplayName() const;
30 const char* SystemPackage() const
31 { return fSystemPackage
; }
32 status_t
SetSystemPackage(const char* package
);
34 void GetPackagePath(const char* name
, char* path
,
37 static bool IsNewer(const PackageVolumeState
* a
,
38 const PackageVolumeState
* b
);
46 typedef DoublyLinkedList
<PackageVolumeState
> PackageVolumeStateList
;
49 class PackageVolumeInfo
: public BReferenceable
{
51 typedef PackageVolumeStateList StateList
;
57 status_t
SetTo(Directory
* baseDirectory
,
58 const char* packagesPath
);
60 const StateList
& States() const
64 PackageVolumeState
* _AddState(const char* stateName
);
65 status_t
_InitState(Directory
* packagesDirectory
,
66 DIR* dir
, PackageVolumeState
* state
);
67 status_t
_ParseActivatedPackagesFile(
68 Directory
* packagesDirectory
,
69 PackageVolumeState
* state
,
70 char* packageName
, size_t packageNameSize
);
77 #endif // PACKAGE_SUPPORT_H