#ifndef __HANDLE_H__ #define __HANDLE_H__ #ifdef __cplusplus #include #include #include #include #include #include class Handle : public Base { public: Handle(const Handle &); virtual ~Handle(); virtual ssize_t read(void *buf, size_t count) throw (GeneralException); virtual ssize_t write(const void *buf, size_t count) throw (GeneralException); bool IsClosed(void); bool IsNonBlock(void); void SetNonBlock(void); virtual bool CanRead(); virtual bool CanWrite(); virtual String GetName(); virtual off_t GetSize(); virtual time_t GetModif(); void close(); int GetHandle(); virtual bool CanWatch(); virtual void Dup(const Handle &); protected: Handle(int h); private: int h; bool closed, nonblock; }; Handle & operator<<(Handle &, const String &); Handle & operator>>(Handle &, String &); #else #error This only works with a C++ compiler #endif #endif