Removal of non-Haiku target platform logic from build system (part 1.)
[haiku.git] / src / tests / system / boot / loader / Handle.h
blobb6d4275fe3869ba5aa4a695650eb272ad877c514
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef HANDLE_H
6 #define HANDLE_H
9 #include <boot/vfs.h>
12 #ifdef __cplusplus
14 class Handle : public Node {
15 public:
16 Handle(int handle, bool takeOwnership = true);
17 Handle(const char *path);
18 Handle();
19 virtual ~Handle();
21 status_t InitCheck();
23 void SetTo(int handle, bool takeOwnership = true);
25 virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize);
26 virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize);
28 virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
29 virtual off_t Size() const;
31 protected:
32 int fHandle;
33 bool fOwnHandle;
34 char *fPath;
37 #endif /* __cplusplus */
39 #endif /* HANDLE_H */