BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / packageinstaller / PackageInfo.h
blob702b5b97803da87a05da0e4e49715cce2f387b80
1 /*
2 * Copyright (c) 2007, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Author:
6 * Ɓukasz 'Sil2100' Zemczak <sil2100@vexillium.org>
7 */
8 #ifndef PACKAGEINFO_H
9 #define PACKAGEINFO_H
11 #include "PackageItem.h"
12 #include <List.h>
13 #include <String.h>
14 #include <File.h>
15 #include <DataIO.h>
16 #include <Path.h>
19 struct pkg_profile;
22 class PackageInfo {
23 public:
24 PackageInfo();
25 PackageInfo(const entry_ref *ref);
26 ~PackageInfo();
28 const char *GetName() { return fName.String(); }
29 const char *GetDescription() { return fDescription.String(); }
30 const char *GetShortDescription() { return fShortDesc.String(); }
31 const char *GetVersion() { return fVersion.String(); }
32 const char *GetDisclaimer() { return fDisclaimer.String(); }
33 BMallocIO *GetSplashScreen() { return fHasImage ? &fImage : NULL; }
34 int32 GetProfileCount() { return fProfiles.CountItems(); }
35 pkg_profile *GetProfile(int32 num) {
36 return static_cast<pkg_profile *>(fProfiles.ItemAt(num)); }
37 int32 GetScriptCount() { return fScripts.CountItems(); }
38 PackageScript *GetScript(int32 num) {
39 return static_cast<PackageScript *>(fScripts.ItemAt(num)); }
41 status_t Parse();
42 status_t InitCheck() { return fStatus; }
44 private:
45 void _AddItem(PackageItem *item, uint64 size, uint32 groups,
46 uint32 path, uint32 cust);
48 status_t fStatus;
50 BFile *fPackageFile;
51 BString fName;
52 BString fDescription;
53 BList fProfiles;
55 BString fShortDesc;
56 BString fDeveloper;
57 BString fVersion;
58 BString fDisclaimer;
59 BMallocIO fImage;
60 bool fHasImage;
62 BList fFiles; // Holds all files in the package
63 BList fScripts;
67 // #pragma mark -
70 struct pkg_profile {
71 pkg_profile() : items(10), space_needed(0), path_type(P_SYSTEM_PATH) {}
72 ~pkg_profile() {}
74 BString name;
75 BString description;
76 BList items;
77 uint64 space_needed;
79 uint8 path_type;
82 #endif