|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58633 - in branches/release: boost/iostreams boost/iostreams/detail boost/iostreams/detail/adapter boost/iostreams/detail/broken_overload_resolution boost/iostreams/detail/streambuf boost/iostreams/device boost/iostreams/filter libs/iostreams libs/iostreams/build libs/iostreams/doc/classes libs/iostreams/doc/functions libs/iostreams/src libs/iostreams/test
From: daniel_james_at_[hidden]
Date: 2010-01-02 06:51:42
Author: danieljames
Date: 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
New Revision: 58633
URL: http://svn.boost.org/trac/boost/changeset/58633
Log:
Merge iostream fixes, mostly by Richard Smith.
Fixes #3612, #3311, #2094, #3010, #2894, #3011, #3352, #3505.
Properties modified:
branches/release/boost/iostreams/ (props changed)
branches/release/libs/iostreams/ (props changed)
Text files modified:
branches/release/boost/iostreams/chain.hpp | 31 ++++---
branches/release/boost/iostreams/checked_operations.hpp | 11 +-
branches/release/boost/iostreams/code_converter.hpp | 10 +-
branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp | 13 +-
branches/release/boost/iostreams/detail/adapter/direct_adapter.hpp | 9 +-
branches/release/boost/iostreams/detail/adapter/range_adapter.hpp | 14 ++-
branches/release/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp | 3
branches/release/boost/iostreams/detail/push_params.hpp | 2
branches/release/boost/iostreams/detail/restrict_impl.hpp | 32 +++++---
branches/release/boost/iostreams/detail/streambuf/direct_streambuf.hpp | 26 ++++--
branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp | 5
branches/release/boost/iostreams/detail/system_failure.hpp | 5
branches/release/boost/iostreams/device/mapped_file.hpp | 14 ++-
branches/release/boost/iostreams/filter/gzip.hpp | 13 +-
branches/release/boost/iostreams/filter/newline.hpp | 5
branches/release/boost/iostreams/filter/zlib.hpp | 7 +
branches/release/boost/iostreams/skip.hpp | 5
branches/release/boost/iostreams/stream_buffer.hpp | 5 +
branches/release/libs/iostreams/build/Jamfile.v2 | 7 +
branches/release/libs/iostreams/doc/classes/null.html | 2
branches/release/libs/iostreams/doc/functions/filter_test.html | 2
branches/release/libs/iostreams/src/bzip2.cpp | 5
branches/release/libs/iostreams/src/file_descriptor.cpp | 19 ++--
branches/release/libs/iostreams/src/file_times.cpp | 159 ---------------------------------------
branches/release/libs/iostreams/src/gzip.cpp | 9 +-
branches/release/libs/iostreams/src/mapped_file.cpp | 35 +++++---
branches/release/libs/iostreams/src/zlib.cpp | 5
branches/release/libs/iostreams/test/restrict_test.cpp | 12 ++-
branches/release/libs/iostreams/test/slice_test.cpp | 3
29 files changed, 188 insertions(+), 280 deletions(-)
Modified: branches/release/boost/iostreams/chain.hpp
==============================================================================
--- branches/release/boost/iostreams/chain.hpp (original)
+++ branches/release/boost/iostreams/chain.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -36,6 +36,7 @@
#include <boost/next_prior.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type.hpp>
#include <boost/iostreams/detail/execute.hpp> // VC6.5 requires this
@@ -149,17 +150,20 @@
// Sets the size of the buffer created for the devices to be added to this
// chain. Does not affect the size of the buffer for devices already
// added.
- void set_device_buffer_size(int n) { pimpl_->device_buffer_size_ = n; }
+ void set_device_buffer_size(std::streamsize n)
+ { pimpl_->device_buffer_size_ = n; }
// Sets the size of the buffer created for the filters to be added
// to this chain. Does not affect the size of the buffer for filters already
// added.
- void set_filter_buffer_size(int n) { pimpl_->filter_buffer_size_ = n; }
+ void set_filter_buffer_size(std::streamsize n)
+ { pimpl_->filter_buffer_size_ = n; }
// Sets the size of the putback buffer for filters and devices to be added
// to this chain. Does not affect the size of the buffer for filters or
// devices already added.
- void set_pback_size(int n) { pimpl_->pback_size_ = n; }
+ void set_pback_size(std::streamsize n)
+ { pimpl_->pback_size_ = n; }
//----------Device interface----------------------------------------------//
@@ -172,7 +176,7 @@
const std::type_info& component_type(int n) const
{
if (static_cast<size_type>(n) >= size())
- throw std::out_of_range("bad chain offset");
+ boost::throw_exception(std::out_of_range("bad chain offset"));
return (*boost::next(list().begin(), n))->component_type();
}
@@ -196,7 +200,7 @@
T* component(int n, boost::type<T>) const
{
if (static_cast<size_type>(n) >= size())
- throw std::out_of_range("bad chain offset");
+ boost::throw_exception(std::out_of_range("bad chain offset"));
streambuf_type* link = *boost::next(list().begin(), n);
if (BOOST_IOSTREAMS_COMPARE_TYPE_ID(link->component_type(), typeid(T)))
return static_cast<T*>(link->component_impl());
@@ -226,7 +230,8 @@
bool strict_sync();
private:
template<typename T>
- void push_impl(const T& t, int buffer_size = -1, int pback_size = -1)
+ void push_impl(const T& t, std::streamsize buffer_size = -1,
+ std::streamsize pback_size = -1)
{
typedef typename iostreams::category_of<T>::type category;
typedef typename unwrap_ios<T>::type component_type;
@@ -238,7 +243,7 @@
typedef typename list_type::iterator iterator;
BOOST_STATIC_ASSERT((is_convertible<category, Mode>::value));
if (is_complete())
- throw std::logic_error("chain complete");
+ boost::throw_exception(std::logic_error("chain complete"));
streambuf_type* prev = !empty() ? list().back() : 0;
buffer_size =
buffer_size != -1 ?
@@ -361,12 +366,12 @@
flags_ &= ~f_complete;
flags_ &= ~f_open;
}
- list_type links_;
- client_type* client_;
- int device_buffer_size_,
- filter_buffer_size_,
- pback_size_;
- int flags_;
+ list_type links_;
+ client_type* client_;
+ std::streamsize device_buffer_size_,
+ filter_buffer_size_,
+ pback_size_;
+ int flags_;
};
friend struct chain_impl;
Modified: branches/release/boost/iostreams/checked_operations.hpp
==============================================================================
--- branches/release/boost/iostreams/checked_operations.hpp (original)
+++ branches/release/boost/iostreams/checked_operations.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -20,6 +20,7 @@
#include <boost/iostreams/seek.hpp>
#include <boost/iostreams/traits.hpp>
#include <boost/iostreams/write.hpp>
+#include <boost/throw_exception.hpp>
// Must come last.
#include <boost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
@@ -93,24 +94,24 @@
template<typename T>
static bool put(T&, typename char_type_of<T>::type)
- { throw cant_write(); }
+ { boost::throw_exception(cant_write()); }
template<typename T>
static std::streamsize
write(T&, const typename char_type_of<T>::type*, std::streamsize)
- { throw cant_write(); }
+ { boost::throw_exception(cant_write()); }
};
template<>
struct read_write_if_impl<output> {
template<typename T>
static typename int_type_of<T>::type get(T&)
- { throw cant_read(); }
+ { boost::throw_exception(cant_read()); }
template<typename T>
static std::streamsize
read(T&, typename char_type_of<T>::type*, std::streamsize)
- { throw cant_read(); }
+ { boost::throw_exception(cant_read()); }
template<typename T>
static bool put(T& t, typename char_type_of<T>::type c)
@@ -139,7 +140,7 @@
template<typename T>
static std::streampos
seek(T&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode)
- { throw cant_seek(); }
+ { boost::throw_exception(cant_seek()); }
};
} // End namespace detail.
Modified: branches/release/boost/iostreams/code_converter.hpp
==============================================================================
--- branches/release/boost/iostreams/code_converter.hpp (original)
+++ branches/release/boost/iostreams/code_converter.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -44,6 +44,7 @@
#include <boost/iostreams/operations.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -152,10 +153,11 @@
} catch (...) { /* */ }
}
- void open(const Device& dev, int buffer_size)
+ template <class T>
+ void open(const T& dev, int buffer_size)
{
if (flags_ & f_open)
- throw BOOST_IOSTREAMS_FAILURE("already open");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("already open"));
if (buffer_size == -1)
buffer_size = default_filter_buffer_size;
int max_length = cvt_.get().max_length();
@@ -354,7 +356,7 @@
case std::codecvt_base::error:
default:
buf.state() = state_type();
- throw code_conversion_error();
+ boost::throw_exception(code_conversion_error());
}
} while (total < n && status != EOF && status != WOULD_BLOCK);
@@ -407,7 +409,7 @@
case std::codecvt_base::error:
default:
buf.state() = state_type();
- throw code_conversion_error();
+ boost::throw_exception(code_conversion_error());
}
}
return total;
Modified: branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp (original)
+++ branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -22,6 +22,7 @@
#include <boost/iostreams/operations.hpp>
#include <boost/mpl/if.hpp>
#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
// Must come last.
#include <boost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
@@ -137,7 +138,7 @@
seek( Device&, stream_offset, BOOST_IOS::seekdir,
BOOST_IOS::openmode, any_tag )
{
- throw cant_seek();
+ boost::throw_exception(cant_seek());
}
template<typename Device>
@@ -171,7 +172,7 @@
static std::streamsize
write( Device&, Dummy*, const typename char_type_of<Device>::type*,
std::streamsize )
- { throw cant_write(); }
+ { boost::throw_exception(cant_write()); }
};
template<>
@@ -179,7 +180,7 @@
template<typename Device, typename Dummy>
static std::streamsize
read(Device&, Dummy*, typename char_type_of<Device>::type*, std::streamsize)
- { throw cant_read(); }
+ { boost::throw_exception(cant_read()); }
template<typename Device, typename Dummy>
static std::streamsize
@@ -205,7 +206,7 @@
static std::streampos
seek( Filter&, Device*, stream_offset,
BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag )
- { throw cant_seek(); }
+ { boost::throw_exception(cant_seek()); }
template<typename Filter, typename Device>
static std::streampos
@@ -252,7 +253,7 @@
static std::streamsize
write( Filter&, Sink*, const typename char_type_of<Filter>::type*,
std::streamsize )
- { throw cant_write(); }
+ { boost::throw_exception(cant_write()); }
};
template<>
@@ -260,7 +261,7 @@
template<typename Filter, typename Source>
static std::streamsize
read(Filter&, Source*, typename char_type_of<Filter>::type*,std::streamsize)
- { throw cant_read(); }
+ { boost::throw_exception(cant_read()); }
template<typename Filter, typename Sink>
static std::streamsize
Modified: branches/release/boost/iostreams/detail/adapter/direct_adapter.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/adapter/direct_adapter.hpp (original)
+++ branches/release/boost/iostreams/detail/adapter/direct_adapter.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -30,6 +30,7 @@
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
// Must come last.
@@ -209,7 +210,7 @@
using namespace std;
pointers& put = ptrs_.second();
if (n > static_cast<std::streamsize>(put.end - put.ptr))
- throw write_area_exhausted();
+ boost::throw_exception(write_area_exhausted());
std::copy(s, s + n, put.ptr);
put.ptr += n;
return n;
@@ -224,7 +225,7 @@
pointers& get = ptrs_.first();
pointers& put = ptrs_.second();
if (way == BOOST_IOS::cur && get.ptr != put.ptr)
- throw bad_seek();
+ boost::throw_exception(bad_seek());
ptrdiff_t next = 0;
if ((which & BOOST_IOS::in) || !is_double::value) {
if (way == BOOST_IOS::beg)
@@ -236,7 +237,7 @@
if (next >= 0 && next <= get.end - get.beg)
get.ptr = get.beg + next;
else
- throw bad_seek();
+ boost::throw_exception(bad_seek());
}
if ((which & BOOST_IOS::out) && is_double::value) {
if (way == BOOST_IOS::beg)
@@ -248,7 +249,7 @@
if (next >= 0 && next <= put.end - put.beg)
put.ptr = put.beg + next;
else
- throw bad_seek();
+ boost::throw_exception(bad_seek());
}
return offset_to_position(next);
}
Modified: branches/release/boost/iostreams/detail/adapter/range_adapter.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/adapter/range_adapter.hpp (original)
+++ branches/release/boost/iostreams/detail/adapter/range_adapter.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -21,6 +21,7 @@
#include <boost/iostreams/detail/error.hpp>
#include <boost/iostreams/positioning.hpp>
#include <boost/mpl/if.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/utility/enable_if.hpp>
@@ -116,7 +117,7 @@
{
while (cur != last && n-- > 0) *cur++ = *s++;
if (cur == last && n > 0)
- throw write_area_exhausted();
+ boost::throw_exception(write_area_exhausted());
return n;
}
};
@@ -144,7 +145,7 @@
std::copy(s, s + count, cur);
cur += count;
if (count < n)
- throw write_area_exhausted();
+ boost::throw_exception(write_area_exhausted());
return n;
}
@@ -156,18 +157,21 @@
using namespace std;
switch (way) {
case BOOST_IOS::beg:
- if (off > last - first || off < 0) throw bad_seek();
+ if (off > last - first || off < 0)
+ boost::throw_exception(bad_seek());
cur = first + off;
break;
case BOOST_IOS::cur:
{
std::ptrdiff_t newoff = cur - first + off;
- if (newoff > last - first || newoff < 0) throw bad_seek();
+ if (newoff > last - first || newoff < 0)
+ boost::throw_exception(bad_seek());
cur += off;
break;
}
case BOOST_IOS::end:
- if (last - first + off < 0 || off > 0) throw bad_seek();
+ if (last - first + off < 0 || off > 0)
+ boost::throw_exception(bad_seek());
cur = last + off;
break;
default:
Modified: branches/release/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp (original)
+++ branches/release/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -9,6 +9,7 @@
#define BOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_BUFFER_HPP_INCLUDED
#include <boost/iostreams/detail/broken_overload_resolution/forward.hpp>
+#include <boost/throw_exception.hpp>
namespace boost { namespace iostreams {
@@ -179,7 +180,7 @@
void check_open()
{
if (this->is_open())
- throw BOOST_IOSTREAMS_FAILURE("already open");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("already open"));
}
};
Modified: branches/release/boost/iostreams/detail/push_params.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/push_params.hpp (original)
+++ branches/release/boost/iostreams/detail/push_params.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -13,7 +13,7 @@
#endif
#define BOOST_IOSTREAMS_PUSH_PARAMS() \
- , int buffer_size = -1 , int pback_size = -1 \
+ , std::streamsize buffer_size = -1 , std::streamsize pback_size = -1 \
/**/
#define BOOST_IOSTREAMS_PUSH_ARGS() , buffer_size, pback_size
Modified: branches/release/boost/iostreams/detail/restrict_impl.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/restrict_impl.hpp (original)
+++ branches/release/boost/iostreams/detail/restrict_impl.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -44,6 +44,7 @@
# include <boost/iostreams/traits.hpp> // mode_of, is_direct.
# include <boost/mpl/bool.hpp>
# include <boost/static_assert.hpp>
+# include <boost/throw_exception.hpp>
# include <boost/type_traits/is_convertible.hpp>
# include <boost/iostreams/detail/config/disable_warnings.hpp>
@@ -159,8 +160,12 @@
{
if (!open_)
open(snk, BOOST_IOS::out);
- if (end_ != -1 && pos_ + n >= end_)
- bad_write();
+ if (end_ != -1 && pos_ + n >= end_) {
+ if(pos_ < end_)
+ pos_ += iostreams::write(this->component(),
+ snk, s, end_ - pos_);
+ boost::throw_exception(bad_write());
+ }
std::streamsize result =
iostreams::write(this->component(), snk, s, n);
pos_ += result;
@@ -181,11 +186,11 @@
// Restriction is half-open; seek relative to the actual end.
pos_ = this->component().seek(dev, off, BOOST_IOS::end);
if (pos_ < beg_)
- bad_seek();
+ boost::throw_exception(bad_seek());
return offset_to_position(pos_ - beg_);
}
if (next < beg_ || (end_ != -1 && next >= end_))
- bad_seek();
+ boost::throw_exception(bad_seek());
pos_ = this->component().seek(dev, next, BOOST_IOS::cur);
return offset_to_position(pos_ - beg_);
}
@@ -248,7 +253,7 @@
end_(len != -1 ? off + len : -1)
{
if (len < -1 || off < 0)
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset"));
iostreams::skip(this->component(), off);
}
@@ -271,8 +276,11 @@
inline std::streamsize restricted_indirect_device<Device>::write
(const char_type* s, std::streamsize n)
{
- if (end_ != -1 && pos_ + n >= end_)
- bad_write();
+ if (end_ != -1 && pos_ + n >= end_) {
+ if(pos_ < end_)
+ pos_ += iostreams::write(this->component(), s, end_ - pos_);
+ boost::throw_exception(bad_write());
+ }
std::streamsize result = iostreams::write(this->component(), s, n);
pos_ += result;
return result;
@@ -293,11 +301,11 @@
// Restriction is half-open; seek relative to the actual end.
pos_ = iostreams::seek(this->component(), off, BOOST_IOS::end);
if (pos_ < beg_)
- bad_seek();
+ boost::throw_exception(bad_seek());
return offset_to_position(pos_ - beg_);
}
- if (next < beg_ || (end_ != -1 && next >= end_))
- bad_seek();
+ if (next < beg_ || (end_ != -1 && next > end_))
+ boost::throw_exception(bad_seek());
pos_ = iostreams::seek(this->component(), next - pos_, BOOST_IOS::cur);
return offset_to_position(pos_ - beg_);
}
@@ -314,7 +322,7 @@
if ( off < 0 || len < -1 ||
(len != -1 && off + len > seq.second - seq.first) )
{
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset"));
}
beg_ = seq.first + off;
end_ = len != -1 ?
@@ -357,7 +365,7 @@
pos_(off), end_(len != -1 ? off + len : -1), open_(false)
{
if (len < -1 || off < 0)
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset"));
}
} // End namespace detail.
Modified: branches/release/boost/iostreams/detail/streambuf/direct_streambuf.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/streambuf/direct_streambuf.hpp (original)
+++ branches/release/boost/iostreams/detail/streambuf/direct_streambuf.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -29,6 +29,7 @@
#include <boost/iostreams/operations.hpp>
#include <boost/iostreams/positioning.hpp>
#include <boost/iostreams/traits.hpp>
+#include <boost/throw_exception.hpp>
// Must come last.
#include <boost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
@@ -55,7 +56,8 @@
char_type, traits_type
) streambuf_type;
public: // stream needs access.
- void open(const T& t, int buffer_size, int pback_size);
+ void open(const T& t, std::streamsize buffer_size,
+ std::streamsize pback_size);
bool is_open() const;
void close();
bool auto_close() const { return auto_close_; }
@@ -111,7 +113,8 @@
{ this->set_true_eof(true); }
template<typename T, typename Tr>
-void direct_streambuf<T, Tr>::open(const T& t, int, int)
+void direct_streambuf<T, Tr>::open
+ (const T& t, std::streamsize, std::streamsize)
{
storage_.reset(t);
init_input(category());
@@ -138,7 +141,7 @@
direct_streambuf<T, Tr>::underflow()
{
if (!ibeg_)
- throw cant_read();
+ boost::throw_exception(cant_read());
if (!gptr())
init_get_area();
return gptr() != iend_ ?
@@ -152,14 +155,14 @@
{
using namespace std;
if (!ibeg_)
- throw cant_read();
+ boost::throw_exception(cant_read());
if (gptr() != 0 && gptr() != ibeg_) {
gbump(-1);
if (!traits_type::eq_int_type(c, traits_type::eof()))
*gptr() = traits_type::to_char_type(c);
return traits_type::not_eof(c);
}
- throw bad_putback();
+ boost::throw_exception(bad_putback());
}
template<typename T, typename Tr>
@@ -167,11 +170,14 @@
direct_streambuf<T, Tr>::overflow(int_type c)
{
using namespace std;
- if (!obeg_) throw BOOST_IOSTREAMS_FAILURE("no write access");
+ if (!obeg_)
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("no write access"));
if (!pptr()) init_put_area();
if (!traits_type::eq_int_type(c, traits_type::eof())) {
if (pptr() == oend_)
- throw BOOST_IOSTREAMS_FAILURE("write area exhausted");
+ boost::throw_exception(
+ BOOST_IOSTREAMS_FAILURE("write area exhausted")
+ );
*pptr() = traits_type::to_char_type(c);
pbump(1);
return c;
@@ -215,7 +221,7 @@
using namespace std;
BOOST_IOS::openmode both = BOOST_IOS::in | BOOST_IOS::out;
if (two_head() && (which & both) == both)
- throw bad_seek();
+ boost::throw_exception(bad_seek());
stream_offset result = -1;
bool one = one_head();
if (one && (pptr() != 0 || gptr()== 0))
@@ -230,7 +236,7 @@
default: assert(0);
}
if (next < 0 || next > (iend_ - ibeg_))
- throw bad_seek();
+ boost::throw_exception(bad_seek());
setg(ibeg_, ibeg_ + next, iend_);
result = next;
}
@@ -244,7 +250,7 @@
default: assert(0);
}
if (next < 0 || next > (oend_ - obeg_))
- throw bad_seek();
+ boost::throw_exception(bad_seek());
pbump(static_cast<int>(next - (pptr() - obeg_)));
result = next;
}
Modified: branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp (original)
+++ branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -35,6 +35,7 @@
#include <boost/iostreams/traits.hpp>
#include <boost/iostreams/operations.hpp>
#include <boost/mpl/if.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
// Must come last.
@@ -151,7 +152,7 @@
template<typename T, typename Tr, typename Alloc, typename Mode>
void indirect_streambuf<T, Tr, Alloc, Mode>::open
- (const T& t, int buffer_size, int pback_size)
+ (const T& t, std::streamsize buffer_size, std::streamsize pback_size)
{
using namespace std;
@@ -274,7 +275,7 @@
*gptr() = traits_type::to_char_type(c);
return traits_type::not_eof(c);
} else {
- throw bad_putback();
+ boost::throw_exception(bad_putback());
}
}
Modified: branches/release/boost/iostreams/detail/system_failure.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/system_failure.hpp (original)
+++ branches/release/boost/iostreams/detail/system_failure.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -18,6 +18,7 @@
#include <cstring>
#include <string>
#include <boost/config.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/iostreams/detail/config/windows_posix.hpp>
#include <boost/iostreams/detail/ios.hpp> // failure.
@@ -73,10 +74,10 @@
{ return system_failure(msg.c_str()); }
inline void throw_system_failure(const char* msg)
-{ throw system_failure(msg); }
+{ boost::throw_exception(system_failure(msg)); }
inline void throw_system_failure(const std::string& msg)
-{ throw system_failure(msg); }
+{ boost::throw_exception(system_failure(msg)); }
} } } // End namespaces detail, iostreams, boost.
Modified: branches/release/boost/iostreams/device/mapped_file.hpp
==============================================================================
--- branches/release/boost/iostreams/device/mapped_file.hpp (original)
+++ branches/release/boost/iostreams/device/mapped_file.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -4,6 +4,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
+#ifndef BOOST_IOSTREAMS_MAPPED_FILE_HPP_INCLUDED
+#define BOOST_IOSTREAMS_MAPPED_FILE_HPP_INCLUDED
+
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
@@ -25,6 +28,7 @@
#include <boost/iostreams/positioning.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_same.hpp>
// Must come last.
@@ -393,10 +397,10 @@
param_type params(p);
if (params.flags) {
if (params.flags != mapped_file::readonly)
- throw new BOOST_IOSTREAMS_FAILURE("invalid flags");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid flags"));
} else {
if (params.mode & BOOST_IOS::out)
- throw new BOOST_IOSTREAMS_FAILURE("invalid mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid mode"));
params.mode |= BOOST_IOS::in;
}
open_impl(params);
@@ -479,10 +483,10 @@
param_type params(p);
if (params.flags) {
if (params.flags & mapped_file::readonly)
- throw new BOOST_IOSTREAMS_FAILURE("invalid flags");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid flags"));
} else {
if (params.mode & BOOST_IOS::in)
- throw new BOOST_IOSTREAMS_FAILURE("invalid mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid mode"));
params.mode |= BOOST_IOS::out;
}
mapped_file::open(params);
@@ -591,3 +595,5 @@
} } // End namespaces iostreams, boost.
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#endif // #ifndef BOOST_IOSTREAMS_MAPPED_FILE_HPP_INCLUDED
Modified: branches/release/boost/iostreams/filter/gzip.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/gzip.hpp (original)
+++ branches/release/boost/iostreams/filter/gzip.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -36,7 +36,8 @@
#include <boost/iostreams/device/back_inserter.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#include <boost/iostreams/pipeline.hpp>
-#include <boost/iostreams/putback.hpp>
+#include <boost/iostreams/putback.hpp>
+#include <boost/throw_exception.hpp>
// Must come last.
#if defined(BOOST_MSVC)
@@ -417,7 +418,7 @@
if (state_ == s_header) {
int c = boost::iostreams::get(peek);
if (traits_type::is_eof(c)) {
- throw gzip_error(gzip::bad_header);
+ boost::throw_exception(gzip_error(gzip::bad_header));
} else if (traits_type::would_block(c)) {
break;
}
@@ -437,19 +438,19 @@
state_ = s_footer;
}
} catch (const zlib_error& e) {
- throw gzip_error(e);
+ boost::throw_exception(gzip_error(e));
}
} else { // state_ == s_footer
int c = boost::iostreams::get(peek);
if (traits_type::is_eof(c)) {
- throw gzip_error(gzip::bad_footer);
+ boost::throw_exception(gzip_error(gzip::bad_footer));
} else if (traits_type::would_block(c)) {
break;
}
footer_.process(c);
if (footer_.done()) {
if (footer_.crc() != this->crc())
- throw gzip_error(gzip::bad_crc);
+ boost::throw_exception(gzip_error(gzip::bad_crc));
int c = boost::iostreams::get(peek);
if (traits_type::is_eof(c)) {
state_ = s_done;
@@ -482,7 +483,7 @@
state_ = s_start;
header_.reset();
footer_.reset();
- throw gzip_error(e);
+ boost::throw_exception(gzip_error(e));
}
state_ = s_start;
}
Modified: branches/release/boost/iostreams/filter/newline.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/newline.hpp (original)
+++ branches/release/boost/iostreams/filter/newline.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -27,6 +27,7 @@
#include <boost/iostreams/pipeline.hpp>
#include <boost/iostreams/putback.hpp>
#include <boost/mpl/bool.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
// Must come last.
@@ -124,7 +125,7 @@
target != newline::dos &&
target != newline::mac )
{
- throw std::logic_error("bad flags");
+ boost::throw_exception(std::logic_error("bad flags"));
}
}
@@ -420,7 +421,7 @@
}
}
private:
- void fail() { throw newline_error(source()); }
+ void fail() { boost::throw_exception(newline_error(source())); }
int& source() { return flags_; }
int source() const { return flags_; }
Modified: branches/release/boost/iostreams/filter/zlib.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/zlib.hpp (original)
+++ branches/release/boost/iostreams/filter/zlib.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -20,6 +20,7 @@
#include <memory> // allocator, bad_alloc.
#include <new>
#include <boost/config.hpp> // MSVC, STATIC_CONSTANT, DEDUCED_TYPENAME, DINKUM.
+#include <boost/cstdint.hpp> // uint*_t
#include <boost/detail/workaround.hpp>
#include <boost/iostreams/constants.hpp> // buffer size.
#include <boost/iostreams/detail/config/auto_link.hpp>
@@ -43,9 +44,9 @@
namespace zlib {
// Typedefs
-typedef unsigned int uint;
-typedef unsigned char byte;
-typedef unsigned long ulong;
+typedef uint32_t uint;
+typedef uint8_t byte;
+typedef uint32_t ulong;
// Prefix 'x' prevents symbols from being redefined when Z_PREFIX is defined
typedef void* (*xalloc_func)(void*, zlib::uint, zlib::uint);
Modified: branches/release/boost/iostreams/skip.hpp
==============================================================================
--- branches/release/boost/iostreams/skip.hpp (original)
+++ branches/release/boost/iostreams/skip.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -22,6 +22,7 @@
#include <boost/mpl/and.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/or.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace iostreams {
@@ -40,7 +41,7 @@
for (stream_offset z = 0; z < off; ) {
typename traits_type::int_type c;
if (traits_type::is_eof(c = iostreams::get(dev)))
- throw BOOST_IOSTREAMS_FAILURE("bad skip offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad skip offset"));
if (!traits_type::would_block(c))
++z;
}
@@ -60,7 +61,7 @@
for (stream_offset z = 0; z < off; ) {
std::streamsize amt;
if ((amt = iostreams::read(flt, dev, &c, 1)) == -1)
- throw BOOST_IOSTREAMS_FAILURE("bad skip offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad skip offset"));
if (amt == 1)
++z;
}
Modified: branches/release/boost/iostreams/stream_buffer.hpp
==============================================================================
--- branches/release/boost/iostreams/stream_buffer.hpp (original)
+++ branches/release/boost/iostreams/stream_buffer.hpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -22,6 +22,7 @@
#include <boost/iostreams/detail/streambuf/indirect_streambuf.hpp>
#include <boost/iostreams/traits.hpp>
#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_convertible.hpp>
// Must come last.
@@ -99,7 +100,9 @@
void open_impl(const T& t BOOST_IOSTREAMS_PUSH_PARAMS())
{ // Used for forwarding.
if (this->is_open())
- BOOST_IOSTREAMS_FAILURE("already open");
+ boost::throw_exception(
+ BOOST_IOSTREAMS_FAILURE("already open")
+ );
base_type::open(t BOOST_IOSTREAMS_PUSH_ARGS());
}
};
Modified: branches/release/libs/iostreams/build/Jamfile.v2
==============================================================================
--- branches/release/libs/iostreams/build/Jamfile.v2 (original)
+++ branches/release/libs/iostreams/build/Jamfile.v2 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -150,7 +150,12 @@
sources += boost_bzip2 bzip2.cpp ;
}
-lib boost_iostreams : $(sources) : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1 ;
+lib boost_iostreams
+ : $(sources)
+ : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
+ :
+ : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
+ ;
boost-install boost_iostreams ;
Modified: branches/release/libs/iostreams/doc/classes/null.html
==============================================================================
--- branches/release/libs/iostreams/doc/classes/null.html (original)
+++ branches/release/libs/iostreams/doc/classes/null.html 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
- <TITLE>Array Devices</TITLE>
+ <TITLE>Null Devices</TITLE>
<LINK REL="stylesheet" HREF="../../../../boost.css">
<LINK REL="stylesheet" HREF="../theme/iostreams.css">
</HEAD>
Modified: branches/release/libs/iostreams/doc/functions/filter_test.html
==============================================================================
--- branches/release/libs/iostreams/doc/functions/filter_test.html (original)
+++ branches/release/libs/iostreams/doc/functions/filter_test.html 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
- <TITLE>Array Devices</TITLE>
+ <TITLE>Filter Testing Functions</TITLE>
<LINK REL="stylesheet" HREF="../../../../boost.css">
<LINK REL="stylesheet" HREF="../theme/iostreams.css">
</HEAD>
Modified: branches/release/libs/iostreams/src/bzip2.cpp
==============================================================================
--- branches/release/libs/iostreams/src/bzip2.cpp (original)
+++ branches/release/libs/iostreams/src/bzip2.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -14,6 +14,7 @@
// than using it (possibly importing code).
#define BOOST_IOSTREAMS_SOURCE
+#include <boost/throw_exception.hpp>
#include <boost/iostreams/detail/config/dyn_link.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include "bzlib.h" // Julian Seward's "bzip.h" header.
@@ -65,9 +66,9 @@
case BZ_STREAM_END:
return;
case BZ_MEM_ERROR:
- throw std::bad_alloc();
+ boost::throw_exception(std::bad_alloc());
default:
- throw bzip2_error(error);
+ boost::throw_exception(bzip2_error(error));
}
}
Modified: branches/release/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- branches/release/libs/iostreams/src/file_descriptor.cpp (original)
+++ branches/release/libs/iostreams/src/file_descriptor.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -22,6 +22,7 @@
#include <boost/iostreams/detail/ios.hpp> // openmodes, failure.
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/integer_traits.hpp>
+#include <boost/throw_exception.hpp>
// OS-specific headers for low-level i/o.
@@ -108,7 +109,7 @@
(BOOST_IOS::in | BOOST_IOS::out) )
{
if (mode & BOOST_IOS::app)
- throw BOOST_IOSTREAMS_FAILURE("bad open mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad open mode"));
dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;
dwCreationDisposition =
(mode & BOOST_IOS::trunc) ?
@@ -116,7 +117,7 @@
OPEN_EXISTING;
} else if (mode & BOOST_IOS::in) {
if (mode & (BOOST_IOS::app |BOOST_IOS::trunc))
- throw BOOST_IOSTREAMS_FAILURE("bad open mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad open mode"));
dwDesiredAccess = GENERIC_READ;
dwCreationDisposition = OPEN_EXISTING;
} else if (mode & BOOST_IOS::out) {
@@ -125,7 +126,7 @@
if (mode & BOOST_IOS::app)
flags_ |= append;
} else {
- throw BOOST_IOSTREAMS_FAILURE("bad open mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad open mode"));
}
HANDLE handle = p.is_wide() ?
@@ -186,7 +187,7 @@
int fd = BOOST_IOSTREAMS_FD_OPEN(p.c_str(), oflag, pmode);
if (fd == -1) {
- throw system_failure("failed opening file");
+ boost::throw_exception(system_failure("failed opening file"));
} else {
handle_ = fd;
flags_ = close_on_exit;
@@ -271,7 +272,7 @@
if ( dwResultLow == INVALID_SET_FILE_POINTER &&
::GetLastError() != NO_ERROR )
{
- throw system_failure("failed seeking");
+ boost::throw_exception(system_failure("failed seeking"));
} else {
return offset_to_position(
(stream_offset(lDistanceToMoveHigh) << 32) + dwResultLow
@@ -281,7 +282,7 @@
if ( off > integer_traits<BOOST_IOSTREAMS_FD_OFFSET>::const_max ||
off < integer_traits<BOOST_IOSTREAMS_FD_OFFSET>::const_min )
{
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset"));
}
stream_offset result =
BOOST_IOSTREAMS_FD_SEEK(
@@ -294,7 +295,7 @@
SEEK_END )
);
if (result == -1)
- throw system_failure("failed seeking");
+ boost::throw_exception(system_failure("failed seeking"));
return offset_to_position(result);
#endif // #ifdef BOOST_IOSTREAMS_WINDOWS
}
@@ -431,7 +432,7 @@
const detail::path& path, BOOST_IOS::openmode mode)
{
if (mode & (BOOST_IOS::out | BOOST_IOS::app | BOOST_IOS::trunc))
- throw BOOST_IOSTREAMS_FAILURE("invalid mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid mode"));
file_descriptor::open(path, mode, BOOST_IOS::in);
}
@@ -482,7 +483,7 @@
const detail::path& path, BOOST_IOS::openmode mode)
{
if (mode & BOOST_IOS::in)
- throw BOOST_IOSTREAMS_FAILURE("invalid mode");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid mode"));
file_descriptor::open(path, mode, BOOST_IOS::out);
}
Modified: branches/release/libs/iostreams/src/file_times.cpp
==============================================================================
--- branches/release/libs/iostreams/src/file_times.cpp (original)
+++ branches/release/libs/iostreams/src/file_times.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -1,158 +1 @@
-/*
- * Distributed under the Boost Software License, Version 1.0.(See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
- *
- * See http://www.boost.org/libs/iostreams for documentation.
- *
- * File: libs/iostreams/src/file_times.cpp
- * Date: Sun Jun 22 14:23:12 MDT 2008
- * Copyright: Jorge Lodos and 2008 CodeRage, LLC
- * Author: Jorge Lodos and Jonathan Turkanis
- * Contact: turkanis at coderage dot com
- *
- * Implements the functions declared in the header
- * <boost/iostreams/detail/file_times.hpp>.
- */
-
-// Define BOOST_IOSTREAMS_SOURCE so that <boost/iostreams/detail/config.hpp>
-// knows that we are building the library (possibly exporting code), rather
-// than using it (possibly importing code).
-#define BOOST_IOSTREAMS_SOURCE
-
-#include <ctime>
-#include <boost/iostreams/detail/config/windows_posix.hpp>
-#include <boost/iostreams/detail/file_times.hpp>
-#include <boost/iostreams/detail/system_failure.hpp>
-
-#ifdef BOOST_IOSTREAMS_WINDOWS
-# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-# include <windows.h>
-#else
-# include <fcntl.h>
-# include <sys/stat.h>
-# include <sys/time.h> // futimes
-# include <sys/types.h> // struct stat.
-#endif
-
-// Must come last
-#include <boost/iostreams/detail/config/disable_warnings.hpp>
-
-namespace boost { namespace iostreams { namespace detail {
-
-std::time_t last_read_time(file_handle h)
-{
-#ifdef BOOST_IOSTREAMS_WINDOWS
- FILETIME ft_access;
- if (!::GetFileTime(h, NULL, &ft_access, NULL))
- throw_system_failure("failed querying last access time");
- SYSTEMTIME st_access;
- if (!FileTimeToSystemTime(&ft_access, &st_access))
- throw_system_failure("failed querying last access time");
- std::tm tm;
- tm.tm_sec = st_access.wSecond;
- tm.tm_min = st_access.wMinute;
- tm.tm_hour = st_access.wHour;
- tm.tm_mday = st_access.wDay;
- tm.tm_mon = st_access.wMonth - 1;
- tm.tm_year = st_access.wYear - 1900;
- return std::mktime(&tm);
-#else
- struct stat info;
- if (::fstat(h, &info) == -1)
- throw_system_failure("failed querying last access time");
- return info.st_atime;
-#endif
-}
-
-void set_last_read_time(file_handle h, time_t tm)
-{
-#ifdef BOOST_IOSTREAMS_WINDOWS
- struct std::tm* t = std::gmtime(&tm);
- if (t == NULL)
- throw_system_failure("failed settting last access time");
- SYSTEMTIME st_access;
- st_access.wSecond = t->tm_sec;
- st_access.wMinute = t->tm_min;
- st_access.wHour = t->tm_hour;
- st_access.wDay = t->tm_mday;
- st_access.wMonth = t->tm_mon + 1;
- st_access.wYear = t->tm_year + 1900;
- FILETIME ft_access;
- if (!SystemTimeToFileTime(&st_access, &ft_access))
- throw_system_failure("failed settting last access time");
- if (!::SetFileTime(h, NULL, &ft_access, NULL))
- throw_system_failure("failed settting last access time");
-#else
- struct stat info;
- if (::fstat(h, &info) == -1)
- throw_system_failure("failed settting last access time");
- struct timeval tv[2];
- tv[0].tv_sec = tm;
- tv[0].tv_usec = 0;
- tv[1].tv_sec = info.st_mtime;
- tv[1].tv_usec = 0;
- if (futimes(h, tv) != 0)
- throw_system_failure("failed settting last access time");
-#endif
-}
-
-std::time_t last_write_time(file_handle h)
-{
-#ifdef BOOST_IOSTREAMS_WINDOWS
- FILETIME ft_modification;
- if (!::GetFileTime(h, NULL, NULL, &ft_modification))
- throw_system_failure("failed querying last modification time");
- SYSTEMTIME st_modification;
- if (!FileTimeToSystemTime(&ft_modification, &st_modification))
- throw_system_failure("failed querying last modification time");
- std::tm tm;
- tm.tm_sec = st_modification.wSecond;
- tm.tm_min = st_modification.wMinute;
- tm.tm_hour = st_modification.wHour;
- tm.tm_mday = st_modification.wDay;
- tm.tm_mon = st_modification.wMonth - 1;
- tm.tm_year = st_modification.wYear - 1900;
- return std::mktime(&tm);
-#else
- struct stat info;
- if (::fstat(h, &info) == -1)
- throw_system_failure("failed querying last modification time");
- return info.st_mtime;
-#endif
-}
-
-void set_last_write_time(file_handle h, time_t tm)
-{
-#ifdef BOOST_IOSTREAMS_WINDOWS
- struct std::tm* t = std::gmtime(&tm);
- if (t == NULL)
- throw_system_failure("failed settting last modification time");
- SYSTEMTIME st_modification;
- st_modification.wSecond = t->tm_sec;
- st_modification.wMinute = t->tm_min;
- st_modification.wHour = t->tm_hour;
- st_modification.wDay = t->tm_mday;
- st_modification.wMonth = t->tm_mon + 1;
- st_modification.wYear = t->tm_year + 1900;
- FILETIME ft_modification;
- if (!SystemTimeToFileTime(&st_modification, &ft_modification))
- throw_system_failure("failed settting last modification time");
- if(!::SetFileTime(h, NULL, &ft_modification, NULL))
- throw_system_failure("failed settting last modification time");
-#else
- struct stat info;
- if (::fstat(h, &info) == -1)
- throw_system_failure("failed settting last modification time");
- struct timeval tv[2];
- tv[0].tv_sec = info.st_atime;
- tv[0].tv_usec = 0;
- tv[1].tv_sec = tm;
- tv[1].tv_usec = 0;
- if (futimes(h, tv) != 0)
- throw_system_failure("failed settting last modification time");
-#endif
-}
-
-} } } // End namespaces detail, iostreams, boost.
-
-#include <boost/iostreams/detail/config/enable_warnings.hpp>
+#error "This file needs to be removed from subversion."
Modified: branches/release/libs/iostreams/src/gzip.cpp
==============================================================================
--- branches/release/libs/iostreams/src/gzip.cpp (original)
+++ branches/release/libs/iostreams/src/gzip.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -15,7 +15,8 @@
#define BOOST_IOSTREAMS_SOURCE
#include <boost/iostreams/detail/config/dyn_link.hpp>
-#include <boost/iostreams/filter/gzip.hpp>
+#include <boost/iostreams/filter/gzip.hpp>
+#include <boost/throw_exception.hpp>
namespace boost { namespace iostreams {
@@ -29,17 +30,17 @@
switch (state_) {
case s_id1:
if (value != gzip::magic::id1)
- throw gzip_error(gzip::bad_header);
+ boost::throw_exception(gzip_error(gzip::bad_header));
state_ = s_id2;
break;
case s_id2:
if (value != gzip::magic::id2)
- throw gzip_error(gzip::bad_header);
+ boost::throw_exception(gzip_error(gzip::bad_header));
state_ = s_cm;
break;
case s_cm:
if (value != gzip::method::deflate)
- throw gzip_error(gzip::bad_method);
+ boost::throw_exception(gzip_error(gzip::bad_method));
state_ = s_flg;
break;
case s_flg:
Modified: branches/release/libs/iostreams/src/mapped_file.cpp
==============================================================================
--- branches/release/libs/iostreams/src/mapped_file.cpp (original)
+++ branches/release/libs/iostreams/src/mapped_file.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -14,6 +14,7 @@
#include <boost/iostreams/detail/file_handle.hpp>
#include <boost/iostreams/detail/system_failure.hpp>
#include <boost/iostreams/device/mapped_file.hpp>
+#include <boost/throw_exception.hpp>
#ifdef BOOST_IOSTREAMS_WINDOWS
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
@@ -82,7 +83,7 @@
void mapped_file_impl::open(param_type p)
{
if (is_open())
- throw BOOST_IOSTREAMS_FAILURE("file already open");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("file already open"));
p.normalize();
open_file(p);
map_file(p); // May modify p.hint
@@ -110,13 +111,19 @@
void mapped_file_impl::resize(stream_offset new_size)
{
if (!is_open())
- throw BOOST_IOSTREAMS_FAILURE("file is closed");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("file is closed"));
if (flags() & mapped_file::priv)
- throw BOOST_IOSTREAMS_FAILURE("can't resize private mapped file");
+ boost::throw_exception(
+ BOOST_IOSTREAMS_FAILURE("can't resize private mapped file")
+ );
if (!(flags() & mapped_file::readwrite))
- throw BOOST_IOSTREAMS_FAILURE("can't resize readonly mapped file");
+ boost::throw_exception(
+ BOOST_IOSTREAMS_FAILURE("can't resize readonly mapped file")
+ );
if (params_.offset >= new_size)
- throw BOOST_IOSTREAMS_FAILURE("can't resize below mapped offset");
+ boost::throw_exception(
+ BOOST_IOSTREAMS_FAILURE("can't resize below mapped offset")
+ );
if (!unmap_file())
cleanup_and_throw("failed unmapping file");
#ifdef BOOST_IOSTREAMS_WINDOWS
@@ -335,7 +342,7 @@
p.hint = 0;
try_map_file(p);
} else {
- throw e;
+ boost::throw_exception(e);
}
}
}
@@ -373,9 +380,9 @@
{
#ifdef BOOST_IOSTREAMS_WINDOWS
DWORD error = GetLastError();
- if (mapped_handle_ != INVALID_HANDLE_VALUE)
+ if (mapped_handle_ != NULL)
::CloseHandle(mapped_handle_);
- if (handle_ != NULL)
+ if (handle_ != INVALID_HANDLE_VALUE)
::CloseHandle(handle_);
SetLastError(error);
#else
@@ -393,9 +400,9 @@
void mapped_file_params_base::normalize()
{
if (mode && flags)
- throw BOOST_IOSTREAMS_FAILURE(
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE(
"at most one of 'mode' and 'flags' may be specified"
- );
+ ));
if (flags) {
switch (flags) {
case mapped_file::readonly:
@@ -403,7 +410,7 @@
case mapped_file::priv:
break;
default:
- throw BOOST_IOSTREAMS_FAILURE("invalid flags");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid flags"));
}
} else {
flags = (mode & BOOST_IOS::out) ?
@@ -412,9 +419,11 @@
mode = BOOST_IOS::openmode();
}
if (offset < 0)
- throw BOOST_IOSTREAMS_FAILURE("invalid offset");
+ boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid offset"));
if (new_file_size < 0)
- throw BOOST_IOSTREAMS_FAILURE("invalid new file size");
+ boost::throw_exception(
+ BOOST_IOSTREAMS_FAILURE("invalid new file size")
+ );
}
} // End namespace detail.
Modified: branches/release/libs/iostreams/src/zlib.cpp
==============================================================================
--- branches/release/libs/iostreams/src/zlib.cpp (original)
+++ branches/release/libs/iostreams/src/zlib.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -14,6 +14,7 @@
// than using it (possibly importing code).
#define BOOST_IOSTREAMS_SOURCE
+#include <boost/throw_exception.hpp>
#include <boost/iostreams/detail/config/dyn_link.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#include "zlib.h" // Jean-loup Gailly's and Mark Adler's "zlib.h" header.
@@ -78,9 +79,9 @@
//case Z_BUF_ERROR:
return;
case Z_MEM_ERROR:
- throw std::bad_alloc();
+ boost::throw_exception(std::bad_alloc());
default:
- throw zlib_error(error);
+ boost::throw_exception(zlib_error(error));
;
}
}
Modified: branches/release/libs/iostreams/test/restrict_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/restrict_test.cpp (original)
+++ branches/release/libs/iostreams/test/restrict_test.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -9,11 +9,15 @@
// replace BOOST_RESTRICT with BOOST_IOSTREAMS_RESTRICT here, since that
// would interfere with the oepration of the header
// <boost/iostreams/restrict.hpp>
-#ifndef BOOST_RESTRICT
-# define BOOST_RESTRICT restrict
-# define BOOST_RESTRICT_HEADER <boost/iostreams/restrict.hpp>
+#include <iostream>
+
+#if defined(BOOST_RESTRICT_USE_SLICE)
+# include <boost/iostreams/slice.hpp>
+# define BOOST_RESTRICT slice
+#else
+# include <boost/iostreams/restrict.hpp>
+# define BOOST_RESTRICT restrict
#endif
-#include BOOST_RESTRICT_HEADER
#include <algorithm> // equal.
#include <cctype>
Modified: branches/release/libs/iostreams/test/slice_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/slice_test.cpp (original)
+++ branches/release/libs/iostreams/test/slice_test.cpp 2010-01-02 06:51:39 EST (Sat, 02 Jan 2010)
@@ -13,6 +13,5 @@
* Tests the overloaded function template boost::iostreams::slice.
*/
-#define BOOST_RESTRICT slice
-#define BOOST_RESTRICT_HEADER <boost/iostreams/slice.hpp>
+#define BOOST_RESTRICT_USE_SLICE
#include "restrict_test.cpp"
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk