diff options
author | Vincent Richard <[email protected]> | 2007-07-09 21:54:01 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2007-07-09 21:54:01 +0000 |
commit | 5e3a99710ba1e62e4048620bb10a81ed6922396c (patch) | |
tree | e51d4e02e3aedf03785917948e7bcc54f3c95041 | |
parent | New GCC definition. (diff) | |
download | vmime-5e3a99710ba1e62e4048620bb10a81ed6922396c.tar.gz vmime-5e3a99710ba1e62e4048620bb10a81ed6922396c.zip |
Throw exception when badbit is set.
-rw-r--r-- | src/utility/stream.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp index ebc40e3a..f9b83e68 100644 --- a/src/utility/stream.cpp +++ b/src/utility/stream.cpp @@ -113,12 +113,14 @@ outputStreamAdapter::outputStreamAdapter(std::ostream& os) void outputStreamAdapter::write (const value_type* const data, const size_type count) { + m_stream.exceptions(std::ios_base::badbit); m_stream.write(data, count); } void outputStreamAdapter::flush() { + m_stream.exceptions(std::ios_base::badbit); m_stream.flush(); } @@ -182,6 +184,7 @@ const bool inputStreamAdapter::eof() const void inputStreamAdapter::reset() { + m_stream.exceptions(std::ios_base::badbit); m_stream.seekg(0, std::ios::beg); m_stream.clear(); } @@ -190,6 +193,7 @@ void inputStreamAdapter::reset() const stream::size_type inputStreamAdapter::read (value_type* const data, const size_type count) { + m_stream.exceptions(std::ios_base::badbit); m_stream.read(data, count); return (m_stream.gcount()); } @@ -197,6 +201,7 @@ const stream::size_type inputStreamAdapter::read const stream::size_type inputStreamAdapter::skip(const size_type count) { + m_stream.exceptions(std::ios_base::badbit); m_stream.ignore(count); return (m_stream.gcount()); } @@ -355,6 +360,7 @@ const bool inputStreamPointerAdapter::eof() const void inputStreamPointerAdapter::reset() { + m_stream->exceptions(std::ios_base::badbit); m_stream->seekg(0, std::ios::beg); m_stream->clear(); } @@ -363,6 +369,7 @@ void inputStreamPointerAdapter::reset() const stream::size_type inputStreamPointerAdapter::read (value_type* const data, const size_type count) { + m_stream->exceptions(std::ios_base::badbit); m_stream->read(data, count); return (m_stream->gcount()); } @@ -370,6 +377,7 @@ const stream::size_type inputStreamPointerAdapter::read const stream::size_type inputStreamPointerAdapter::skip(const size_type count) { + m_stream->exceptions(std::ios_base::badbit); m_stream->ignore(count); return (m_stream->gcount()); } |