15af32e75SAxel Dörfler /* 27a3fa7d3SAxel Dörfler * Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 37a3fa7d3SAxel Dörfler * Distributed under the terms of the MIT License. 45af32e75SAxel Dörfler */ 55af32e75SAxel Dörfler #ifndef HANDLE_H 65af32e75SAxel Dörfler #define HANDLE_H 75af32e75SAxel Dörfler 85af32e75SAxel Dörfler 95af32e75SAxel Dörfler #include <boot/vfs.h> 105af32e75SAxel Dörfler 115af32e75SAxel Dörfler 12*7d41530fSAugustin Cavalier class Handle : public Node { 135af32e75SAxel Dörfler public: 14d5cd4a9dSPulkoMandy Handle(intptr_t handle, bool takeOwnership = true); 155af32e75SAxel Dörfler Handle(); 165af32e75SAxel Dörfler virtual ~Handle(); 175af32e75SAxel Dörfler 18d5cd4a9dSPulkoMandy void SetHandle(intptr_t handle, bool takeOwnership = true); 195af32e75SAxel Dörfler 205af32e75SAxel Dörfler virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize); 215af32e75SAxel Dörfler virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize); 225af32e75SAxel Dörfler 235af32e75SAxel Dörfler virtual off_t Size() const; 245af32e75SAxel Dörfler 255af32e75SAxel Dörfler protected: 26d5cd4a9dSPulkoMandy intptr_t fHandle; 275af32e75SAxel Dörfler bool fOwnHandle; 285af32e75SAxel Dörfler }; 295af32e75SAxel Dörfler 305af32e75SAxel Dörfler #endif /* HANDLE_H */ 31