merged changes from iostreams_dev, revisions 42947-42962: fixed tickets 1003, 1139, 1140, 1149

[SVN r42970]
This commit is contained in:
Jonathan Turkanis 2008-01-25 17:56:25 +00:00
parent 8aa731d9d4
commit 2ffbb03e07
5 changed files with 35 additions and 12 deletions

View File

@ -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>

View File

@ -114,12 +114,12 @@ struct multichar_filter : filter<Mode, Ch> {
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;
//----------------------------------------------------------------------------//

View File

@ -32,9 +32,8 @@ template<typename Chain, typename Access, typename Mode> class chainbuf;
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) >

View File

@ -57,7 +57,7 @@ private:
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 @@ private:
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)

View File

@ -144,6 +144,26 @@ void regex_filter_test()
"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* [])