diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-05-24 15:10:19 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-05-24 15:10:19 +0000 |
commit | ecc191f590f76584a14c9c51727412b0b7b3086e (patch) | |
tree | b27ee434ed541ba3a386ff6a3238f66b9451ef22 /src/membuf.cpp | |
parent | 71191e311d949b1b7bdd74fc36a14306f492c181 (diff) | |
download | libbu++-ecc191f590f76584a14c9c51727412b0b7b3086e.tar.gz libbu++-ecc191f590f76584a14c9c51727412b0b7b3086e.tar.bz2 libbu++-ecc191f590f76584a14c9c51727412b0b7b3086e.tar.xz libbu++-ecc191f590f76584a14c9c51727412b0b7b3086e.zip |
Changed the Bu::Stream API, setSize is now standard. There may be a few more
things that should be added. A few of them still need to be implemented. I
know that truncate for Bu::File is possible on windows, I've used it before, but
hell if I can find it. Myriad also needs the setSize function completed.
Diffstat (limited to 'src/membuf.cpp')
-rw-r--r-- | src/membuf.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/membuf.cpp b/src/membuf.cpp index 0c1c441..b822641 100644 --- a/src/membuf.cpp +++ b/src/membuf.cpp | |||
@@ -140,6 +140,15 @@ void Bu::MemBuf::setBlocking( bool ) | |||
140 | { | 140 | { |
141 | } | 141 | } |
142 | 142 | ||
143 | void Bu::MemBuf::setSize( long iSize ) | ||
144 | { | ||
145 | if( iSize < 0 ) | ||
146 | iSize = 0; | ||
147 | sBuf.setSize( iSize ); | ||
148 | if( nPos > iSize ) | ||
149 | nPos = iSize; | ||
150 | } | ||
151 | |||
143 | Bu::FString &Bu::MemBuf::getString() | 152 | Bu::FString &Bu::MemBuf::getString() |
144 | { | 153 | { |
145 | return sBuf; | 154 | return sBuf; |