NullStreams.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_NULLSTREAMS_H
00014 #define _SUPPORT_NULLSTREAMS_H
00015 
00021 #include <support/ByteStream.h>
00022 #include <support/SupportDefs.h>
00023 #include <support/ITextStream.h>
00024 
00025 #if _SUPPORTS_NAMESPACE
00026 namespace palmos {
00027 namespace support {
00028 #endif
00029 
00034 class BNullStream : public BnByteOutput, public BnByteInput
00035 {
00036 public:
00037     BNullStream();
00038     
00039     virtual SValue Inspect(const sptr<IBinder>& caller, const SValue &which, uint32_t flags = 0);
00040     virtual ssize_t WriteV(const struct iovec *vector, ssize_t count, uint32_t flags = 0);
00041     virtual status_t Sync();
00042     virtual ssize_t ReadV(const struct iovec * /*vector*/, ssize_t /*count*/, uint32_t flags = 0);
00043 
00044 protected:
00045     virtual ~BNullStream();
00046 
00047 private:
00048     BNullStream(const BNullStream&);
00049     BNullStream& operator=(const BNullStream&);
00050 };
00051 
00052 class BNullTextOutput : public ITextOutput
00053 {
00054 public:
00055     BNullTextOutput();
00056     
00057     virtual status_t                Print(  const char *debugText,
00058                                             ssize_t len = -1);
00059     
00061     virtual void                    MoveIndent( int32_t delta);
00062     
00064 
00068     virtual status_t                LogV(   const log_info& info,
00069                                             const iovec *vector,
00070                                             ssize_t count,
00071                                             uint32_t flags = 0);
00072 
00073     virtual void                    Flush();
00074     virtual status_t                Sync();
00075 
00076 protected:
00077     virtual ~BNullTextOutput();
00078 
00079 private:
00080     BNullTextOutput(const BNullTextOutput&);
00081     BNullTextOutput& operator=(const BNullTextOutput&);
00082 };
00083 
00086 #if _SUPPORTS_NAMESPACE
00087 } } // namespace palmos::support
00088 #endif
00089 
00090 #endif // _SUPPORT_NULLSTREAMS_H