diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-01-20 18:09:04 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-01-20 18:09:04 +0000 |
commit | 393f1b414746a7f1977971dd7659dd2b47092b11 (patch) | |
tree | 81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/nullstream.cpp | |
parent | c259f95bd0e58b247940a339bb9b4b401b4e9438 (diff) | |
parent | 7e25a863325dc3e9762397e700030969e093b087 (diff) | |
download | libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2 libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip |
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically
update your projects.
Diffstat (limited to 'src/nullstream.cpp')
-rw-r--r-- | src/nullstream.cpp | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/src/nullstream.cpp b/src/nullstream.cpp index 40c636c..9552cc5 100644 --- a/src/nullstream.cpp +++ b/src/nullstream.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/nullstream.h" | 8 | #include "bu/nullstream.h" |
2 | 9 | ||
3 | Bu::NullStream::NullStream() : | 10 | Bu::NullStream::NullStream() : |
@@ -15,39 +22,39 @@ void Bu::NullStream::close() | |||
15 | sRead = sWrote = 0; | 22 | sRead = sWrote = 0; |
16 | } | 23 | } |
17 | 24 | ||
18 | size_t Bu::NullStream::read( void *pBuf, size_t nBytes ) | 25 | Bu::size Bu::NullStream::read( void *pBuf, Bu::size nBytes ) |
19 | { | 26 | { |
20 | memset( pBuf, 0, nBytes ); | 27 | memset( pBuf, 0, nBytes ); |
21 | sRead += nBytes; | 28 | sRead += nBytes; |
22 | return nBytes; | 29 | return nBytes; |
23 | } | 30 | } |
24 | 31 | ||
25 | Bu::FString Bu::NullStream::readLine() | 32 | Bu::String Bu::NullStream::readLine() |
26 | { | 33 | { |
27 | sRead++; | 34 | sRead++; |
28 | return Bu::FString("\0", 1 ); | 35 | return Bu::String("\0", 1 ); |
29 | } | 36 | } |
30 | 37 | ||
31 | size_t Bu::NullStream::write( const void *, size_t nBytes ) | 38 | Bu::size Bu::NullStream::write( const void *, Bu::size nBytes ) |
32 | { | 39 | { |
33 | sWrote += nBytes; | 40 | sWrote += nBytes; |
34 | return nBytes; | 41 | return nBytes; |
35 | } | 42 | } |
36 | 43 | ||
37 | long Bu::NullStream::tell() | 44 | Bu::size Bu::NullStream::tell() |
38 | { | 45 | { |
39 | return sRead + sWrote; | 46 | return sRead + sWrote; |
40 | } | 47 | } |
41 | 48 | ||
42 | void Bu::NullStream::seek( long ) | 49 | void Bu::NullStream::seek( Bu::size ) |
43 | { | 50 | { |
44 | } | 51 | } |
45 | 52 | ||
46 | void Bu::NullStream::setPos( long ) | 53 | void Bu::NullStream::setPos( Bu::size ) |
47 | { | 54 | { |
48 | } | 55 | } |
49 | 56 | ||
50 | void Bu::NullStream::setPosEnd( long ) | 57 | void Bu::NullStream::setPosEnd( Bu::size ) |
51 | { | 58 | { |
52 | } | 59 | } |
53 | 60 | ||
@@ -99,7 +106,22 @@ void Bu::NullStream::setBlocking( bool ) | |||
99 | { | 106 | { |
100 | } | 107 | } |
101 | 108 | ||
102 | void Bu::NullStream::setSize( long ) | 109 | void Bu::NullStream::setSize( Bu::size ) |
110 | { | ||
111 | } | ||
112 | |||
113 | Bu::size Bu::NullStream::getSize() const | ||
114 | { | ||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | Bu::size Bu::NullStream::getBlockSize() const | ||
119 | { | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | Bu::String Bu::NullStream::getLocation() const | ||
103 | { | 124 | { |
125 | return ""; | ||
104 | } | 126 | } |
105 | 127 | ||