1 /* 2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef AUTO_PACKAGE_ATTRIBUTES_H 6 #define AUTO_PACKAGE_ATTRIBUTES_H 7 8 9 #include <SupportDefs.h> 10 11 #include "StringKey.h" 12 13 14 class AttributeCookie; 15 class Package; 16 17 18 enum AutoPackageAttribute { 19 AUTO_PACKAGE_ATTRIBUTE_ENUM_FIRST, 20 AUTO_PACKAGE_ATTRIBUTE_PACKAGE = AUTO_PACKAGE_ATTRIBUTE_ENUM_FIRST, 21 22 AUTO_PACKAGE_ATTRIBUTE_ENUM_COUNT 23 }; 24 25 26 struct AutoPackageAttributes { 27 static bool AttributeForName(const StringKey& name, 28 AutoPackageAttribute& _attribute); 29 static const String& NameForAttribute( 30 AutoPackageAttribute attribute); 31 static const void* GetAttributeValue(const Package* package, 32 AutoPackageAttribute attribute, 33 off_t& _size, uint32& _type); 34 35 static status_t OpenCookie(Package* package, 36 const StringKey& name, int openMode, 37 AttributeCookie*& _cookie); 38 }; 39 40 41 #endif // AUTO_PACKAGE_ATTRIBUTES_H 42