xref: /haiku/src/kits/package/hpkg/PackageContentHandler.cpp (revision e7be020ce59cd8a50dcb9a782b3b15cfa769396c)
1 /*
2  * Copyright 2009-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <package/hpkg/PackageContentHandler.h>
8 
9 
10 namespace BPackageKit {
11 
12 namespace BHPKG {
13 
14 
15 // #pragma mark - BLowLevelPackageContentHandler
16 
17 
18 static const char* kAttributeNames[B_HPKG_ATTRIBUTE_ID_ENUM_COUNT + 1] = {
19 	"dir:entry",
20 	"file:type",
21 	"file:permissions",
22 	"file:user",
23 	"file:group",
24 	"file:atime",
25 	"file:mtime",
26 	"file:crtime",
27 	"file:atime:nanos",
28 	"file:mtime:nanos",
29 	"file:crtime:nanos",
30 	"file:attribute",
31 	"file:attribute:type",
32 	"data",
33 	"data:compression",
34 	"data:size",
35 	"data:chunk_size",
36 	"symlink:path",
37 	"package:name",
38 	"package:summary",
39 	"package:description",
40 	"package:vendor",
41 	"package:packager",
42 	"package:flags",
43 	"package:architecture",
44 	"package:version.major",
45 	"package:version.minor",
46 	"package:version.micro",
47 	"package:version.release",
48 	"package:copyright",
49 	"package:license",
50 	"package:provides",
51 	"package:provides.type",
52 	"package:requires",
53 	"package:supplements",
54 	"package:conflicts",
55 	"package:freshens",
56 	"package:replaces",
57 	"package:resolvable.operator",
58 	"package:checksum",
59 	"package:version.prerelease",
60 	"package:provides.compatible",
61 	"package:url",
62 	"package:source-url",
63 	"package:install-path",
64 	NULL
65 };
66 
67 
68 BLowLevelPackageContentHandler::~BLowLevelPackageContentHandler()
69 {
70 }
71 
72 
73 /*static*/ const char*
74 BLowLevelPackageContentHandler::AttributeNameForID(uint8 id)
75 {
76 	if (id >= B_HPKG_ATTRIBUTE_ID_ENUM_COUNT)
77 		return NULL;
78 
79 	return kAttributeNames[id];
80 }
81 
82 
83 // #pragma mark - BPackageContentHandler
84 
85 
86 BPackageContentHandler::~BPackageContentHandler()
87 {
88 }
89 
90 
91 }	// namespace BHPKG
92 
93 }	// namespace BPackageKit
94