Added default cookie Close() implementation

Added trivial implementation for AttributeCookie::Close() and
AttributeDirectoryCookie::Close() and removed the identical Close()
implementations in derived classes.
This commit is contained in:
Ingo Weinhold 2011-06-26 04:37:30 +02:00
parent ecf2e3d342
commit a83fe53dce
10 changed files with 16 additions and 26 deletions

View File

@ -10,3 +10,10 @@
AttributeCookie::~AttributeCookie() AttributeCookie::~AttributeCookie()
{ {
} }
status_t
AttributeCookie::Close()
{
return B_OK;
}

View File

@ -15,7 +15,7 @@ class AttributeCookie {
public: public:
virtual ~AttributeCookie(); virtual ~AttributeCookie();
virtual status_t Close() = 0; virtual status_t Close();
virtual status_t ReadAttribute(off_t offset, void* buffer, virtual status_t ReadAttribute(off_t offset, void* buffer,
size_t* bufferSize) = 0; size_t* bufferSize) = 0;
virtual status_t ReadAttributeStat(struct stat* st) = 0; virtual status_t ReadAttributeStat(struct stat* st) = 0;

View File

@ -10,3 +10,10 @@
AttributeDirectoryCookie::~AttributeDirectoryCookie() AttributeDirectoryCookie::~AttributeDirectoryCookie()
{ {
} }
status_t
AttributeDirectoryCookie::Close()
{
return B_OK;
}

View File

@ -15,7 +15,7 @@ class AttributeDirectoryCookie {
public: public:
virtual ~AttributeDirectoryCookie(); virtual ~AttributeDirectoryCookie();
virtual status_t Close() = 0; virtual status_t Close();
virtual status_t Read(dev_t volumeID, ino_t nodeID, virtual status_t Read(dev_t volumeID, ino_t nodeID,
struct dirent* buffer, size_t bufferSize, struct dirent* buffer, size_t bufferSize,
uint32* _count) = 0; uint32* _count) = 0;

View File

@ -7,13 +7,6 @@
#include "EmptyAttributeDirectoryCookie.h" #include "EmptyAttributeDirectoryCookie.h"
status_t
EmptyAttributeDirectoryCookie::Close()
{
return B_OK;
}
status_t status_t
EmptyAttributeDirectoryCookie::Read(dev_t volumeID, ino_t nodeID, EmptyAttributeDirectoryCookie::Read(dev_t volumeID, ino_t nodeID,
struct dirent* buffer, size_t bufferSize, uint32* _count) struct dirent* buffer, size_t bufferSize, uint32* _count)

View File

@ -11,7 +11,6 @@
class EmptyAttributeDirectoryCookie : public AttributeDirectoryCookie { class EmptyAttributeDirectoryCookie : public AttributeDirectoryCookie {
public: public:
virtual status_t Close();
virtual status_t Read(dev_t volumeID, ino_t nodeID, virtual status_t Read(dev_t volumeID, ino_t nodeID,
struct dirent* buffer, size_t bufferSize, struct dirent* buffer, size_t bufferSize,
uint32* _count); uint32* _count);

View File

@ -100,13 +100,6 @@ UnpackingAttributeCookie::Open(PackageNode* packageNode, const char* name,
} }
status_t
UnpackingAttributeCookie::Close()
{
return B_OK;
}
status_t status_t
UnpackingAttributeCookie::ReadAttribute(off_t offset, void* buffer, UnpackingAttributeCookie::ReadAttribute(off_t offset, void* buffer,
size_t* bufferSize) size_t* bufferSize)

View File

@ -25,7 +25,6 @@ public:
static status_t Open(PackageNode* packageNode, const char* name, static status_t Open(PackageNode* packageNode, const char* name,
int openMode, AttributeCookie*& _cookie); int openMode, AttributeCookie*& _cookie);
virtual status_t Close();
virtual status_t ReadAttribute(off_t offset, void* buffer, virtual status_t ReadAttribute(off_t offset, void* buffer,
size_t* bufferSize); size_t* bufferSize);
virtual status_t ReadAttributeStat(struct stat* st); virtual status_t ReadAttributeStat(struct stat* st);

View File

@ -45,13 +45,6 @@ UnpackingAttributeDirectoryCookie::Open(PackageNode* packageNode,
} }
status_t
UnpackingAttributeDirectoryCookie::Close()
{
return B_OK;
}
status_t status_t
UnpackingAttributeDirectoryCookie::Read(dev_t volumeID, ino_t nodeID, UnpackingAttributeDirectoryCookie::Read(dev_t volumeID, ino_t nodeID,
struct dirent* buffer, size_t bufferSize, uint32* _count) struct dirent* buffer, size_t bufferSize, uint32* _count)

View File

@ -24,7 +24,6 @@ public:
static status_t Open(PackageNode* packageNode, static status_t Open(PackageNode* packageNode,
AttributeDirectoryCookie*& _cookie); AttributeDirectoryCookie*& _cookie);
virtual status_t Close();
virtual status_t Read(dev_t volumeID, ino_t nodeID, virtual status_t Read(dev_t volumeID, ino_t nodeID,
struct dirent* buffer, size_t bufferSize, struct dirent* buffer, size_t bufferSize,
uint32* _count); uint32* _count);