11e7416d9SIngo Weinhold /* 21e7416d9SIngo Weinhold * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de. 31e7416d9SIngo Weinhold * Distributed under the terms of the MIT License. 41e7416d9SIngo Weinhold */ 51e7416d9SIngo Weinhold #ifndef AUTO_PACKAGE_ATTRIBUTES_H 61e7416d9SIngo Weinhold #define AUTO_PACKAGE_ATTRIBUTES_H 71e7416d9SIngo Weinhold 81e7416d9SIngo Weinhold 91e7416d9SIngo Weinhold #include <SupportDefs.h> 101e7416d9SIngo Weinhold 11d07c930cSIngo Weinhold #include "StringKey.h" 12d07c930cSIngo Weinhold 131e7416d9SIngo Weinhold 141e7416d9SIngo Weinhold class AttributeCookie; 151e7416d9SIngo Weinhold class Package; 161e7416d9SIngo Weinhold 171e7416d9SIngo Weinhold 181e7416d9SIngo Weinhold enum AutoPackageAttribute { 191e7416d9SIngo Weinhold AUTO_PACKAGE_ATTRIBUTE_ENUM_FIRST, 201e7416d9SIngo Weinhold AUTO_PACKAGE_ATTRIBUTE_PACKAGE = AUTO_PACKAGE_ATTRIBUTE_ENUM_FIRST, 21*efe26659SIngo Weinhold AUTO_PACKAGE_ATTRIBUTE_PACKAGE_FILE, 221e7416d9SIngo Weinhold 231e7416d9SIngo Weinhold AUTO_PACKAGE_ATTRIBUTE_ENUM_COUNT 241e7416d9SIngo Weinhold }; 251e7416d9SIngo Weinhold 261e7416d9SIngo Weinhold 271e7416d9SIngo Weinhold struct AutoPackageAttributes { 28d07c930cSIngo Weinhold static bool AttributeForName(const StringKey& name, 291e7416d9SIngo Weinhold AutoPackageAttribute& _attribute); 30d07c930cSIngo Weinhold static const String& NameForAttribute( 311e7416d9SIngo Weinhold AutoPackageAttribute attribute); 321e7416d9SIngo Weinhold static const void* GetAttributeValue(const Package* package, 331e7416d9SIngo Weinhold AutoPackageAttribute attribute, 341e7416d9SIngo Weinhold off_t& _size, uint32& _type); 351e7416d9SIngo Weinhold 36d07c930cSIngo Weinhold static status_t OpenCookie(Package* package, 37d07c930cSIngo Weinhold const StringKey& name, int openMode, 38d07c930cSIngo Weinhold AttributeCookie*& _cookie); 391e7416d9SIngo Weinhold }; 401e7416d9SIngo Weinhold 411e7416d9SIngo Weinhold 421e7416d9SIngo Weinhold #endif // AUTO_PACKAGE_ATTRIBUTES_H 43