needs access to the stream directly). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4654 a95241bf-73f2-0310-859d-f6bbb57e9c96
80 lines
928 B
C++
80 lines
928 B
C++
/*
|
|
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
|
|
** Distributed under the terms of the OpenBeOS License.
|
|
*/
|
|
|
|
|
|
#include "File.h"
|
|
|
|
|
|
namespace BFS {
|
|
|
|
File::File(Volume &volume, block_run run)
|
|
:
|
|
fStream(volume, run)
|
|
{
|
|
}
|
|
|
|
|
|
File::File(Volume &volume, off_t id)
|
|
:
|
|
fStream(volume, id)
|
|
{
|
|
}
|
|
|
|
|
|
File::File(const Stream &stream)
|
|
:
|
|
fStream(stream)
|
|
{
|
|
}
|
|
|
|
|
|
File::~File()
|
|
{
|
|
}
|
|
|
|
|
|
status_t
|
|
File::InitCheck()
|
|
{
|
|
return fStream.InitCheck();
|
|
}
|
|
|
|
|
|
ssize_t
|
|
File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
|
|
{
|
|
return fStream.ReadAt(pos, (uint8 *)buffer, &bufferSize);
|
|
}
|
|
|
|
|
|
ssize_t
|
|
File::WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize)
|
|
{
|
|
return EROFS;
|
|
}
|
|
|
|
|
|
status_t
|
|
File::GetName(char *nameBuffer, size_t bufferSize) const
|
|
{
|
|
return B_ERROR;
|
|
}
|
|
|
|
|
|
int32
|
|
File::Type() const
|
|
{
|
|
return S_IFREG;
|
|
}
|
|
|
|
|
|
off_t
|
|
File::Size() const
|
|
{
|
|
return fStream.Size();
|
|
}
|
|
|
|
} // namespace BFS
|