xref: /haiku/src/add-ons/kernel/file_systems/packagefs/package/PackageNodeAttribute.h (revision 040a81419dda83d1014e9dc94936a4cb3f027303)
1 /*
2  * Copyright 2009-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef PACKAGE_NODE_ATTRIBUTE_H
6 #define PACKAGE_NODE_ATTRIBUTE_H
7 
8 
9 #include <util/DoublyLinkedList.h>
10 
11 #include "PackageData.h"
12 
13 #include "String.h"
14 
15 
16 class PackageNode;
17 
18 
19 class PackageNodeAttribute
20 	: public DoublyLinkedListLinkImpl<PackageNodeAttribute> {
21 public:
22 								PackageNodeAttribute(uint32 type,
23 									const PackageData& data);
24 								~PackageNodeAttribute();
25 
26 			const String&		Name() const	{ return fName; }
27 			uint32				Type() const	{ return fType; }
28 			const PackageData&	Data() const	{ return fData; }
29 
30 			void				Init(const String& name);
31 
32 			void				SetIndexCookie(void* cookie)
33 									{ fIndexCookie = cookie; }
34 			void*				IndexCookie() const
35 									{ return fIndexCookie; }
36 
37 protected:
38 			PackageData			fData;
39 			String				fName;
40 			void*				fIndexCookie;
41 			uint32				fType;
42 };
43 
44 
45 typedef DoublyLinkedList<PackageNodeAttribute> PackageNodeAttributeList;
46 
47 
48 #endif	// PACKAGE_NODE_ATTRIBUTE_H
49