From 819cfbbc5f8caa65575caefb3e602d2d9f7425b3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 4 Aug 2010 14:34:20 +0000 Subject: Fixed some minor compilation warnings in some tests, and started adding NullStream. This version doesn't compile yet, but will soon. You can back off a revision or just delet nullstream for now. --- checkinst.sh | 2 +- src/nullstream.cpp | 31 +++++++++++++++++++++++++++++++ src/nullstream.h | 37 +++++++++++++++++++++++++++++++++++++ src/tests/itoqueue1.cpp | 1 + src/tests/itoqueue2.cpp | 1 + 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/nullstream.cpp create mode 100644 src/nullstream.h diff --git a/checkinst.sh b/checkinst.sh index e5490bc..c2b892d 100755 --- a/checkinst.sh +++ b/checkinst.sh @@ -1,6 +1,6 @@ #!/bin/bash -CMD="ln -svf $PWD/bu /usr/include; ln -svf $PWD/libbu++.a /usr/lib" +CMD="ln -svf $PWD/bu /usr/include; ln -svf $PWD/libbu++.a /usr/lib; ln -svf $PWD/viewcsv /usr/bin" if [ $UID == 0 ]; then bash -c "$CMD" diff --git a/src/nullstream.cpp b/src/nullstream.cpp new file mode 100644 index 0000000..364b58a --- /dev/null +++ b/src/nullstream.cpp @@ -0,0 +1,31 @@ +#include "bu/nullstream.h" + +Bu::NullStream::NullStream() +{ +} + +Bu::NullStream::~NullStream() +{ +} + +void Bu::NullStream::close(); +size_t Bu::NullStream::read( void *pBuf, size_t nBytes ); +Bu::FString Bu::NullStream::readLine(); +size_t Bu::NullStream::write( const void *pBuf, size_t nBytes ); +long Bu::NullStream::tell(); +void Bu::NullStream::seek( long offset ); +void Bu::NullStream::setPos( long pos ); +void Bu::NullStream::setPosEnd( long pos ); +bool Bu::NullStream::isEos(); +bool Bu::NullStream::isOpen(); +void Bu::NullStream::flush(); +bool Bu::NullStream::canRead(); +bool Bu::NullStream::canWrite(); +bool Bu::NullStream::isReadable(); +bool Bu::NullStream::isWritable(); +bool Bu::NullStream::isSeekable(); +bool Bu::NullStream::isBlocking(); +void Bu::NullStream::setBlocking( bool bBlocking=true ); +void Bu::NullStream::setSize( long iSize ); + + diff --git a/src/nullstream.h b/src/nullstream.h new file mode 100644 index 0000000..5440af6 --- /dev/null +++ b/src/nullstream.h @@ -0,0 +1,37 @@ +#ifndef BU_NULL_STREAM_H +#define BU_NULL_STREAM_H + +#include "bu/stream.h" + +namespace Bu +{ + class NullStream : public Bu::Stream + { + public: + NullStream(); + virtual ~NullStream(); + + virtual void close(); + virtual size_t read( void *pBuf, size_t nBytes ); + virtual Bu::FString readLine(); + virtual size_t write( const void *pBuf, size_t nBytes ); + using Bu::Stream::write; + virtual long tell(); + virtual void seek( long offset ); + virtual void setPos( long pos ); + virtual void setPosEnd( long pos ); + virtual bool isEos(); + virtual bool isOpen(); + virtual void flush(); + virtual bool canRead(); + virtual bool canWrite(); + virtual bool isReadable(); + virtual bool isWritable(); + virtual bool isSeekable(); + virtual bool isBlocking(); + virtual void setBlocking( bool bBlocking=true ); + virtual void setSize( long iSize ); + }; +}; + +#endif diff --git a/src/tests/itoqueue1.cpp b/src/tests/itoqueue1.cpp index a034c87..11dbb49 100644 --- a/src/tests/itoqueue1.cpp +++ b/src/tests/itoqueue1.cpp @@ -9,6 +9,7 @@ #include "bu/ito.h" #include "bu/itoqueue.h" #include +#include class Reader : public Bu::Ito { diff --git a/src/tests/itoqueue2.cpp b/src/tests/itoqueue2.cpp index b11aa32..5283854 100644 --- a/src/tests/itoqueue2.cpp +++ b/src/tests/itoqueue2.cpp @@ -9,6 +9,7 @@ #include "bu/ito.h" #include "bu/itoqueue.h" #include +#include class Reader : public Bu::Ito { -- cgit v1.2.3