1/* 2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef UNPACKING_ATTRIBUTE_COOKIE_H 6#define UNPACKING_ATTRIBUTE_COOKIE_H 7 8 9#include "AttributeCookie.h" 10#include "StringKey.h" 11 12 13class AttributeIndexer; 14class Package; 15class PackageNode; 16class PackageNodeAttribute; 17 18 19class UnpackingAttributeCookie : public AttributeCookie { 20public: 21 UnpackingAttributeCookie( 22 PackageNode* packageNode, 23 PackageNodeAttribute* attribute, 24 int openMode); 25 virtual ~UnpackingAttributeCookie(); 26 27 static status_t Open(PackageNode* packageNode, 28 const StringKey& name, int openMode, 29 AttributeCookie*& _cookie); 30 31 virtual status_t ReadAttribute(off_t offset, void* buffer, 32 size_t* bufferSize); 33 virtual status_t ReadAttributeStat(struct stat* st); 34 35 static status_t ReadAttribute(PackageNode* packageNode, 36 PackageNodeAttribute* attribute, 37 off_t offset, void* buffer, 38 size_t* bufferSize); 39 static status_t IndexAttribute(PackageNode* packageNode, 40 AttributeIndexer* indexer); 41 42private: 43 PackageNode* fPackageNode; 44 Package* fPackage; 45 PackageNodeAttribute* fAttribute; 46 int fOpenMode; 47}; 48 49 50#endif // UNPACKING_ATTRIBUTE_COOKIE_H 51