diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2010-08-04 14:34:20 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2010-08-04 14:34:20 +0000 |
| commit | 819cfbbc5f8caa65575caefb3e602d2d9f7425b3 (patch) | |
| tree | 28cd579d2d7df17eee495d31598c4d570c56c95a | |
| parent | b5fea4de7f2e20fbb768aef2ed72249c80b1bf9d (diff) | |
| download | libbu++-819cfbbc5f8caa65575caefb3e602d2d9f7425b3.tar.gz libbu++-819cfbbc5f8caa65575caefb3e602d2d9f7425b3.tar.bz2 libbu++-819cfbbc5f8caa65575caefb3e602d2d9f7425b3.tar.xz libbu++-819cfbbc5f8caa65575caefb3e602d2d9f7425b3.zip | |
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.
Diffstat (limited to '')
| -rwxr-xr-x | checkinst.sh | 2 | ||||
| -rw-r--r-- | src/nullstream.cpp | 31 | ||||
| -rw-r--r-- | src/nullstream.h | 37 | ||||
| -rw-r--r-- | src/tests/itoqueue1.cpp | 1 | ||||
| -rw-r--r-- | src/tests/itoqueue2.cpp | 1 |
5 files changed, 71 insertions, 1 deletions
diff --git a/checkinst.sh b/checkinst.sh index e5490bc..c2b892d 100755 --- a/checkinst.sh +++ b/checkinst.sh | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | CMD="ln -svf $PWD/bu /usr/include; ln -svf $PWD/libbu++.a /usr/lib" | 3 | CMD="ln -svf $PWD/bu /usr/include; ln -svf $PWD/libbu++.a /usr/lib; ln -svf $PWD/viewcsv /usr/bin" |
| 4 | 4 | ||
| 5 | if [ $UID == 0 ]; then | 5 | if [ $UID == 0 ]; then |
| 6 | bash -c "$CMD" | 6 | 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 @@ | |||
| 1 | #include "bu/nullstream.h" | ||
| 2 | |||
| 3 | Bu::NullStream::NullStream() | ||
| 4 | { | ||
| 5 | } | ||
| 6 | |||
| 7 | Bu::NullStream::~NullStream() | ||
| 8 | { | ||
| 9 | } | ||
| 10 | |||
| 11 | void Bu::NullStream::close(); | ||
| 12 | size_t Bu::NullStream::read( void *pBuf, size_t nBytes ); | ||
| 13 | Bu::FString Bu::NullStream::readLine(); | ||
| 14 | size_t Bu::NullStream::write( const void *pBuf, size_t nBytes ); | ||
| 15 | long Bu::NullStream::tell(); | ||
| 16 | void Bu::NullStream::seek( long offset ); | ||
| 17 | void Bu::NullStream::setPos( long pos ); | ||
| 18 | void Bu::NullStream::setPosEnd( long pos ); | ||
| 19 | bool Bu::NullStream::isEos(); | ||
| 20 | bool Bu::NullStream::isOpen(); | ||
| 21 | void Bu::NullStream::flush(); | ||
| 22 | bool Bu::NullStream::canRead(); | ||
| 23 | bool Bu::NullStream::canWrite(); | ||
| 24 | bool Bu::NullStream::isReadable(); | ||
| 25 | bool Bu::NullStream::isWritable(); | ||
| 26 | bool Bu::NullStream::isSeekable(); | ||
| 27 | bool Bu::NullStream::isBlocking(); | ||
| 28 | void Bu::NullStream::setBlocking( bool bBlocking=true ); | ||
| 29 | void Bu::NullStream::setSize( long iSize ); | ||
| 30 | |||
| 31 | |||
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 @@ | |||
| 1 | #ifndef BU_NULL_STREAM_H | ||
| 2 | #define BU_NULL_STREAM_H | ||
| 3 | |||
| 4 | #include "bu/stream.h" | ||
| 5 | |||
| 6 | namespace Bu | ||
| 7 | { | ||
| 8 | class NullStream : public Bu::Stream | ||
| 9 | { | ||
| 10 | public: | ||
| 11 | NullStream(); | ||
| 12 | virtual ~NullStream(); | ||
| 13 | |||
| 14 | virtual void close(); | ||
| 15 | virtual size_t read( void *pBuf, size_t nBytes ); | ||
| 16 | virtual Bu::FString readLine(); | ||
| 17 | virtual size_t write( const void *pBuf, size_t nBytes ); | ||
| 18 | using Bu::Stream::write; | ||
| 19 | virtual long tell(); | ||
| 20 | virtual void seek( long offset ); | ||
| 21 | virtual void setPos( long pos ); | ||
| 22 | virtual void setPosEnd( long pos ); | ||
| 23 | virtual bool isEos(); | ||
| 24 | virtual bool isOpen(); | ||
| 25 | virtual void flush(); | ||
| 26 | virtual bool canRead(); | ||
| 27 | virtual bool canWrite(); | ||
| 28 | virtual bool isReadable(); | ||
| 29 | virtual bool isWritable(); | ||
| 30 | virtual bool isSeekable(); | ||
| 31 | virtual bool isBlocking(); | ||
| 32 | virtual void setBlocking( bool bBlocking=true ); | ||
| 33 | virtual void setSize( long iSize ); | ||
| 34 | }; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #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 @@ | |||
| 9 | #include "bu/ito.h" | 9 | #include "bu/ito.h" |
| 10 | #include "bu/itoqueue.h" | 10 | #include "bu/itoqueue.h" |
| 11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
| 12 | #include <stdio.h> | ||
| 12 | 13 | ||
| 13 | class Reader : public Bu::Ito | 14 | class Reader : public Bu::Ito |
| 14 | { | 15 | { |
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 @@ | |||
| 9 | #include "bu/ito.h" | 9 | #include "bu/ito.h" |
| 10 | #include "bu/itoqueue.h" | 10 | #include "bu/itoqueue.h" |
| 11 | #include <errno.h> | 11 | #include <errno.h> |
| 12 | #include <stdio.h> | ||
| 12 | 13 | ||
| 13 | class Reader : public Bu::Ito | 14 | class Reader : public Bu::Ito |
| 14 | { | 15 | { |
