2 * Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
11 #include <StorageDefs.h>
17 class BFile
: public BNode
, public BPositionIO
{
20 BFile(const BFile
&file
);
21 BFile(const entry_ref
*ref
, uint32 openMode
);
22 BFile(const BEntry
*entry
, uint32 openMode
);
23 BFile(const char *path
, uint32 openMode
);
24 BFile(const BDirectory
*dir
, const char *path
, uint32 openMode
);
27 status_t
SetTo(const entry_ref
*ref
, uint32 openMode
);
28 status_t
SetTo(const BEntry
*entry
, uint32 openMode
);
29 status_t
SetTo(const char *path
, uint32 openMode
);
30 status_t
SetTo(const BDirectory
*dir
, const char *path
, uint32 openMode
);
32 bool IsReadable() const;
33 bool IsWritable() const;
35 virtual ssize_t
Read(void *buffer
, size_t size
);
36 virtual ssize_t
ReadAt(off_t location
, void *buffer
, size_t size
);
37 virtual ssize_t
Write(const void *buffer
, size_t size
);
38 virtual ssize_t
WriteAt(off_t location
, const void *buffer
, size_t size
);
40 virtual off_t
Seek(off_t offset
, uint32 seekMode
);
41 virtual off_t
Position() const;
43 virtual status_t
SetSize(off_t size
);
44 virtual status_t
GetSize(off_t
* size
) const;
46 BFile
&operator=(const BFile
&file
);
49 virtual void _PhiloFile1();
50 virtual void _PhiloFile2();
51 virtual void _PhiloFile3();
52 virtual void _PhiloFile4();
53 virtual void _PhiloFile5();
54 virtual void _PhiloFile6();
56 uint32 _reservedData
[8];
60 virtual void close_fd();
63 // The file's open mode.