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 UNPACKING_ATTRIBUTE_COOKIE_H 61e7416d9SIngo Weinhold #define UNPACKING_ATTRIBUTE_COOKIE_H 71e7416d9SIngo Weinhold 81e7416d9SIngo Weinhold 91e7416d9SIngo Weinhold #include "AttributeCookie.h" 10*d07c930cSIngo Weinhold #include "StringKey.h" 111e7416d9SIngo Weinhold 121e7416d9SIngo Weinhold 131e7416d9SIngo Weinhold class AttributeIndexer; 141e7416d9SIngo Weinhold class Package; 151e7416d9SIngo Weinhold class PackageNode; 161e7416d9SIngo Weinhold class PackageNodeAttribute; 171e7416d9SIngo Weinhold 181e7416d9SIngo Weinhold 191e7416d9SIngo Weinhold class UnpackingAttributeCookie : public AttributeCookie { 201e7416d9SIngo Weinhold public: 211e7416d9SIngo Weinhold UnpackingAttributeCookie( 221e7416d9SIngo Weinhold PackageNode* packageNode, 231e7416d9SIngo Weinhold PackageNodeAttribute* attribute, 241e7416d9SIngo Weinhold int openMode); 251e7416d9SIngo Weinhold virtual ~UnpackingAttributeCookie(); 261e7416d9SIngo Weinhold 27*d07c930cSIngo Weinhold static status_t Open(PackageNode* packageNode, 28*d07c930cSIngo Weinhold const StringKey& name, int openMode, 29*d07c930cSIngo Weinhold AttributeCookie*& _cookie); 301e7416d9SIngo Weinhold 311e7416d9SIngo Weinhold virtual status_t ReadAttribute(off_t offset, void* buffer, 321e7416d9SIngo Weinhold size_t* bufferSize); 331e7416d9SIngo Weinhold virtual status_t ReadAttributeStat(struct stat* st); 341e7416d9SIngo Weinhold 351e7416d9SIngo Weinhold static status_t ReadAttribute(PackageNode* packageNode, 361e7416d9SIngo Weinhold PackageNodeAttribute* attribute, 371e7416d9SIngo Weinhold off_t offset, void* buffer, 381e7416d9SIngo Weinhold size_t* bufferSize); 391e7416d9SIngo Weinhold static status_t IndexAttribute(PackageNode* packageNode, 401e7416d9SIngo Weinhold AttributeIndexer* indexer); 411e7416d9SIngo Weinhold 421e7416d9SIngo Weinhold private: 431e7416d9SIngo Weinhold PackageNode* fPackageNode; 441e7416d9SIngo Weinhold Package* fPackage; 451e7416d9SIngo Weinhold PackageNodeAttribute* fAttribute; 461e7416d9SIngo Weinhold int fOpenMode; 471e7416d9SIngo Weinhold }; 481e7416d9SIngo Weinhold 491e7416d9SIngo Weinhold 501e7416d9SIngo Weinhold #endif // UNPACKING_ATTRIBUTE_COOKIE_H 51