IOSStream.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _SUPPORT_IOSSTREAM_H
00014 #define _SUPPORT_IOSSTREAM_H
00015 
00021 #include <sys/uio.h>
00022 #include <support/SupportDefs.h>
00023 #include <support/ByteStream.h>
00024 
00025 #if _SUPPORTS_NAMESPACE
00026 namespace palmos {
00027 namespace support {
00028 #endif
00029 
00034 /*---------------------------------------------------------------------*/
00035 
00036 enum {
00037     B_IOSSTREAM_NO_AUTO_CLOSE       = 0x0001,
00038     B_IOSSTREAM_HIDE_INPUT          = 0x0002,
00039     B_IOSSTREAM_HIDE_OUTPUT         = 0x0004
00040 };
00041 
00043 class BIOSStream : public BnByteOutput, public BnByteInput
00044 {
00045 public:
00046                             BIOSStream( int32_t descriptor, uint32_t flags = 0);
00047     virtual                 ~BIOSStream();
00048     
00049     virtual SValue          Inspect(const sptr<IBinder>& caller, const SValue &which, uint32_t flags = 0);
00050 
00051     virtual ssize_t         WriteV(const struct iovec *vector, ssize_t count, uint32_t flags = 0);
00052     virtual status_t        Sync();
00053     virtual ssize_t         ReadV(const struct iovec *vector, ssize_t count, uint32_t flags = 0);
00054 
00055     virtual int32_t         FileDescriptor() const;
00056 
00057 private:
00058             int32_t         m_descriptor;
00059             uint32_t        m_flags;
00060 };
00061 
00062 /*-------------------------------------------------------------*/
00063 
00066 #if _SUPPORTS_NAMESPACE
00067 } } // namespace palmos::support
00068 #endif
00069 
00070 #endif /* _SUPPORT_IOSSTREAM_H */