From ecc191f590f76584a14c9c51727412b0b7b3086e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 24 May 2010 15:10:19 +0000 Subject: 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. --- src/membuf.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/membuf.cpp') 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 ) { } +void Bu::MemBuf::setSize( long iSize ) +{ + if( iSize < 0 ) + iSize = 0; + sBuf.setSize( iSize ); + if( nPos > iSize ) + nPos = iSize; +} + Bu::FString &Bu::MemBuf::getString() { return sBuf; -- cgit v1.2.3