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 11*d07c930cSIngo Weinhold #include "StringKey.h" 12*d07c930cSIngo 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, 211e7416d9SIngo Weinhold 221e7416d9SIngo Weinhold AUTO_PACKAGE_ATTRIBUTE_ENUM_COUNT 231e7416d9SIngo Weinhold }; 241e7416d9SIngo Weinhold 251e7416d9SIngo Weinhold 261e7416d9SIngo Weinhold struct AutoPackageAttributes { 27*d07c930cSIngo Weinhold static bool AttributeForName(const StringKey& name, 281e7416d9SIngo Weinhold AutoPackageAttribute& _attribute); 29*d07c930cSIngo Weinhold static const String& NameForAttribute( 301e7416d9SIngo Weinhold AutoPackageAttribute attribute); 311e7416d9SIngo Weinhold static const void* GetAttributeValue(const Package* package, 321e7416d9SIngo Weinhold AutoPackageAttribute attribute, 331e7416d9SIngo Weinhold off_t& _size, uint32& _type); 341e7416d9SIngo Weinhold 35*d07c930cSIngo Weinhold static status_t OpenCookie(Package* package, 36*d07c930cSIngo Weinhold const StringKey& name, int openMode, 37*d07c930cSIngo Weinhold AttributeCookie*& _cookie); 381e7416d9SIngo Weinhold }; 391e7416d9SIngo Weinhold 401e7416d9SIngo Weinhold 411e7416d9SIngo Weinhold #endif // AUTO_PACKAGE_ATTRIBUTES_H 42