diff options
Diffstat (limited to 'src/utility/stream.cpp')
-rw-r--r-- | src/utility/stream.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp index 9b402e6a..bb5300ef 100644 --- a/src/utility/stream.cpp +++ b/src/utility/stream.cpp @@ -38,7 +38,7 @@ namespace utility { // stream -const stream::size_type stream::getBlockSize() const +stream::size_type stream::getBlockSize() const { return 32768; // 32 KB } @@ -60,13 +60,13 @@ outputStream& operator<<(outputStream& os, const string& str) } -const stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os) +stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os) { return bufferedStreamCopy(is, os, 0, NULL); } -const stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, +stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os, const stream::size_type length, progressListener* progress) { const stream::size_type blockSize = @@ -176,7 +176,7 @@ inputStreamAdapter::inputStreamAdapter(std::istream& is) } -const bool inputStreamAdapter::eof() const +bool inputStreamAdapter::eof() const { return (m_stream.eof()); } @@ -190,7 +190,7 @@ void inputStreamAdapter::reset() } -const stream::size_type inputStreamAdapter::read +stream::size_type inputStreamAdapter::read (value_type* const data, const size_type count) { m_stream.exceptions(std::ios_base::badbit); @@ -199,7 +199,7 @@ const stream::size_type inputStreamAdapter::read } -const stream::size_type inputStreamAdapter::skip(const size_type count) +stream::size_type inputStreamAdapter::skip(const size_type count) { m_stream.exceptions(std::ios_base::badbit); m_stream.ignore(count); @@ -223,7 +223,7 @@ inputStreamStringAdapter::inputStreamStringAdapter(const string& buffer, } -const bool inputStreamStringAdapter::eof() const +bool inputStreamStringAdapter::eof() const { return (m_pos >= m_end); } @@ -235,7 +235,7 @@ void inputStreamStringAdapter::reset() } -const stream::size_type inputStreamStringAdapter::read +stream::size_type inputStreamStringAdapter::read (value_type* const data, const size_type count) { if (m_pos + count >= m_end) @@ -255,7 +255,7 @@ const stream::size_type inputStreamStringAdapter::read } -const stream::size_type inputStreamStringAdapter::skip(const size_type count) +stream::size_type inputStreamStringAdapter::skip(const size_type count) { if (m_pos + count >= m_end) { @@ -280,7 +280,7 @@ inputStreamStringProxyAdapter::inputStreamStringProxyAdapter(const stringProxy& } -const bool inputStreamStringProxyAdapter::eof() const +bool inputStreamStringProxyAdapter::eof() const { return (m_pos >= m_buffer.length()); } @@ -292,7 +292,7 @@ void inputStreamStringProxyAdapter::reset() } -const stream::size_type inputStreamStringProxyAdapter::read +stream::size_type inputStreamStringProxyAdapter::read (value_type* const data, const size_type count) { const size_type remaining = m_buffer.length() - m_pos; @@ -312,7 +312,7 @@ const stream::size_type inputStreamStringProxyAdapter::read } -const stream::size_type inputStreamStringProxyAdapter::skip(const size_type count) +stream::size_type inputStreamStringProxyAdapter::skip(const size_type count) { const size_type remaining = m_buffer.length() - m_pos; @@ -352,7 +352,7 @@ inputStreamPointerAdapter::~inputStreamPointerAdapter() } -const bool inputStreamPointerAdapter::eof() const +bool inputStreamPointerAdapter::eof() const { return (m_stream->eof()); } @@ -366,7 +366,7 @@ void inputStreamPointerAdapter::reset() } -const stream::size_type inputStreamPointerAdapter::read +stream::size_type inputStreamPointerAdapter::read (value_type* const data, const size_type count) { m_stream->exceptions(std::ios_base::badbit); @@ -375,7 +375,7 @@ const stream::size_type inputStreamPointerAdapter::read } -const stream::size_type inputStreamPointerAdapter::skip(const size_type count) +stream::size_type inputStreamPointerAdapter::skip(const size_type count) { m_stream->exceptions(std::ios_base::badbit); m_stream->ignore(count); @@ -392,7 +392,7 @@ inputStreamByteBufferAdapter::inputStreamByteBufferAdapter(const byte_t* buffer, } -const bool inputStreamByteBufferAdapter::eof() const +bool inputStreamByteBufferAdapter::eof() const { return m_pos >= m_length; } @@ -404,7 +404,7 @@ void inputStreamByteBufferAdapter::reset() } -const stream::size_type inputStreamByteBufferAdapter::read +stream::size_type inputStreamByteBufferAdapter::read (value_type* const data, const size_type count) { const size_type remaining = m_length - m_pos; @@ -426,7 +426,7 @@ const stream::size_type inputStreamByteBufferAdapter::read } -const stream::size_type inputStreamByteBufferAdapter::skip(const size_type count) +stream::size_type inputStreamByteBufferAdapter::skip(const size_type count) { const size_type remaining = m_length - m_pos; @@ -468,7 +468,7 @@ void outputStreamSocketAdapter::flush() } -const stream::size_type outputStreamSocketAdapter::getBlockSize() const +stream::size_type outputStreamSocketAdapter::getBlockSize() const { return 16384; // 16 KB } @@ -483,7 +483,7 @@ inputStreamSocketAdapter::inputStreamSocketAdapter(net::socket& sok) } -const bool inputStreamSocketAdapter::eof() const +bool inputStreamSocketAdapter::eof() const { // Can't know... return false; @@ -496,14 +496,14 @@ void inputStreamSocketAdapter::reset() } -const stream::size_type inputStreamSocketAdapter::read +stream::size_type inputStreamSocketAdapter::read (value_type* const data, const size_type count) { return m_socket.receiveRaw(data, count); } -const stream::size_type inputStreamSocketAdapter::skip +stream::size_type inputStreamSocketAdapter::skip (const size_type /* count */) { // Not supported @@ -511,7 +511,7 @@ const stream::size_type inputStreamSocketAdapter::skip } -const stream::size_type inputStreamSocketAdapter::getBlockSize() const +stream::size_type inputStreamSocketAdapter::getBlockSize() const { return 16384; // 16 KB } |