|
Boost-Commit : |
From: technews_at_[hidden]
Date: 2008-01-25 12:56:25
Author: turkanis
Date: 2008-01-25 12:56:25 EST (Fri, 25 Jan 2008)
New Revision: 42970
URL: http://svn.boost.org/trac/boost/changeset/42970
Log:
merged changes from iostreams_dev, revisions 42947-42962: fixed tickets 1003, 1139, 1140, 1149
Text files modified:
trunk/boost/iostreams/concepts.hpp | 12 ++++++------
trunk/boost/iostreams/detail/streambuf/linked_streambuf.hpp | 5 ++---
trunk/boost/iostreams/filter/regex.hpp | 8 ++++++--
trunk/libs/iostreams/doc/classes/null.html | 2 +-
trunk/libs/iostreams/test/regex_filter_test.cpp | 20 ++++++++++++++++++++
5 files changed, 35 insertions(+), 12 deletions(-)
Modified: trunk/boost/iostreams/concepts.hpp
==============================================================================
--- trunk/boost/iostreams/concepts.hpp (original)
+++ trunk/boost/iostreams/concepts.hpp 2008-01-25 12:56:25 EST (Fri, 25 Jan 2008)
@@ -114,12 +114,12 @@
template<typename Mode, typename Ch = wchar_t>
struct multichar_wfilter : multichar_filter<Mode, Ch> { };
-typedef multichar_filter<input> multichar_input_filter;
-typedef multichar_filter<input> multichar_input_wfilter;
-typedef multichar_filter<output> multichar_output_filter;
-typedef multichar_filter<output> multichar_output_wfilter;
-typedef multichar_filter<dual_use> multichar_dual_use_filter;
-typedef multichar_filter<dual_use> multichar_dual_use_wfilter;
+typedef multichar_filter<input> multichar_input_filter;
+typedef multichar_wfilter<input> multichar_input_wfilter;
+typedef multichar_filter<output> multichar_output_filter;
+typedef multichar_wfilter<output> multichar_output_wfilter;
+typedef multichar_filter<dual_use> multichar_dual_use_filter;
+typedef multichar_wfilter<dual_use> multichar_dual_use_wfilter;
//----------------------------------------------------------------------------//
Modified: trunk/boost/iostreams/detail/streambuf/linked_streambuf.hpp
==============================================================================
--- trunk/boost/iostreams/detail/streambuf/linked_streambuf.hpp (original)
+++ trunk/boost/iostreams/detail/streambuf/linked_streambuf.hpp 2008-01-25 12:56:25 EST (Fri, 25 Jan 2008)
@@ -32,9 +32,8 @@
using base::setg; using base::gbump; using base::pbase; \
using base::pptr; using base::epptr; using base::setp; \
using base::pbump; using base::underflow; using base::pbackfail; \
- using base::xsgetn; using base::overflow; using base::sputc; \
- using base::xsputn; using base::sync; using base::seekoff; \
- using base::seekpos; \
+ using base::xsgetn; using base::overflow; using base::xsputn; \
+ using base::sync; using base::seekoff; using base::seekpos; \
/**/
template<typename Ch, typename Tr = BOOST_IOSTREAMS_CHAR_TRAITS(Ch) >
Modified: trunk/boost/iostreams/filter/regex.hpp
==============================================================================
--- trunk/boost/iostreams/filter/regex.hpp (original)
+++ trunk/boost/iostreams/filter/regex.hpp 2008-01-25 12:56:25 EST (Fri, 25 Jan 2008)
@@ -57,7 +57,7 @@
return;
iterator first(&src[0], &src[0] + src.size(), re_, flags_);
iterator last;
- const Ch* suffix = 0; // Prevent GCC 2.95 warning.
+ const Ch* suffix = 0;
for (; first != last; ++first) {
dest.insert( dest.end(),
first->prefix().first,
@@ -68,7 +68,11 @@
replacement.end() );
suffix = first->suffix().first;
}
- dest.insert(dest.end(), suffix, &src[0] + src.size());
+ if (suffix) {
+ dest.insert(dest.end(), suffix, &src[0] + src.size());
+ } else {
+ dest.insert(dest.end(), &src[0], &src[0] + src.size());
+ }
}
struct simple_formatter {
simple_formatter(const string_type& fmt, flag_type fmt_flags)
Modified: trunk/libs/iostreams/doc/classes/null.html
==============================================================================
--- trunk/libs/iostreams/doc/classes/null.html (original)
+++ trunk/libs/iostreams/doc/classes/null.html 2008-01-25 12:56:25 EST (Fri, 25 Jan 2008)
@@ -186,7 +186,7 @@
<UL>
<LI><CODE>read</CODE> returns <CODE>-1</CODE>, indicating end-of-sequence
<LI><CODE>write</CODE> consumes but ignores the entire contents of the character buffer passed to it
-<LI><CODE>seek</CODE> consumes but ignores the entire contents of the character buffer passed to it
+<LI><CODE>seek</CODE> returns an invalid stream position
</UL>
<H4>Synopsis</H4>
Modified: trunk/libs/iostreams/test/regex_filter_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/regex_filter_test.cpp (original)
+++ trunk/libs/iostreams/test/regex_filter_test.cpp 2008-01-25 12:56:25 EST (Fri, 25 Jan 2008)
@@ -144,6 +144,26 @@
"failed writing to format-string-based regex_filter in chunks"
);
}
+
+ {
+ // Note: the ifstream second is placed in a nested scope because
+ // closing and reopening a single ifstream failed for CW 9.4 on Windows.
+
+ // Test reading from a regex filter with no matches; this checks that
+ // Ticket #1139 is fixed
+ boost::regex match_xxx("xxx");
+ test_file test2;
+ filtering_istream
+ first(boost::iostreams::regex_filter(match_xxx, replace_lower()));
+ first.push(file_source(test.name(), in_mode));
+ {
+ ifstream second(test2.name().c_str(), in_mode);
+ BOOST_CHECK_MESSAGE(
+ compare_streams_in_chars(first, second),
+ "failed reading from a regex filter with no matches"
+ );
+ }
+ }
}
test_suite* init_unit_test_suite(int, char* [])
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