Merge branch 'develop'

This commit is contained in:
Edward Diener
2017-02-19 03:55:56 -05:00
4 changed files with 51 additions and 8 deletions

View File

@ -83,17 +83,20 @@ be preceded by an escape character, as will the escape character itself:</p>
// manipulator for const std::basic_string&amp;
template &lt;class Char, class Traits, class Alloc&gt;
<b><i>unspecified-type1</i></b> quoted(const std::basic_string&lt;Char, Traits, Alloc&gt;&amp; string, Char escape='\\', Char delim='\&quot;');
<b><i>unspecified-type1</i></b> quoted(const std::basic_string&lt;Char, Traits, Alloc&gt;&amp; string,
Char escape='\\', Char delim='\&quot;');
// manipulator for const C-string*
template &lt;class Char&gt;
<b><i>unspecified-type2</i></b> quoted(const Char* string, Char escape='\\', Char delim='\&quot;');
<b><i>unspecified-type2</i></b> quoted(const Char* string,
Char escape='\\', Char delim='\&quot;');
// manipulator for non-const std::basic_string&amp;
template &lt;class Char, class Traits, class Alloc&gt;
<b><i>unspecified-type3</i></b> quoted(std::basic_string&lt;Char, Traits, Alloc&gt;&amp; string, Char escape='\\', Char delim='\&quot;');
<b><i>unspecified-type3</i></b> quoted(std::basic_string&lt;Char, Traits, Alloc&gt;&amp; string,
Char escape='\\', Char delim='\&quot;');
}
}</pre>
<p><i><b><code>unspecified_type1</code></b></i>, <i><b><code>unspecified_type2</code></b></i>,
@ -155,7 +158,7 @@ form of the templates. </p>
<p>Distributed under the Boost Software License, Version 1.0. See
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->20 June 2010<!--webbot bot="Timestamp" endspan i-checksum="17544" --></p>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->08 March 2013<!--webbot bot="Timestamp" endspan i-checksum="27284" --></p>
</body>
</html>

15
meta/libraries.json Normal file
View File

@ -0,0 +1,15 @@
{
"key": "io",
"name": "IO State Savers",
"authors": [
"Daryle Walker"
],
"description": "The I/O sub-library of Boost helps segregate the large number of Boost headers. This sub-library should contain various items to use with/for the standard I/O library.",
"documentation": "doc/ios_state.html",
"category": [
"IO"
],
"maintainers": [
"Daryle Walker <darylew -at- hotmail.com>"
]
}

View File

@ -10,6 +10,7 @@
// 15 Jun 2003 Adjust to changes in Boost.Test (Daryle Walker)
// 26 Feb 2002 Initial version (Daryle Walker)
#include <boost/config.hpp>
#include <boost/test/minimal.hpp> // main, BOOST_CHECK, etc.
#include <boost/cstdlib.hpp> // for boost::exit_success
@ -24,7 +25,9 @@
#include <ostream> // for std::endl, std::ostream
#include <streambuf> // for std::streambuf
#include <string> // for std::string
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
#include <stdexcept>
#endif
// Facet with the bool names spelled backwards
class backward_bool_names
@ -181,11 +184,15 @@ saver_tests_1
boost::io::ios_exception_saver const ies( output );
boost::io::ios_iostate_saver const iis( output );
output.exceptions( ios_base::eofbit );
output.exceptions( ios_base::eofbit | ios_base::badbit );
output.setstate( ios_base::eofbit );
BOOST_ERROR( "previous line should have thrown" );
}
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
catch ( std::exception &f )
#else
catch ( ios_base::failure &f )
#endif
{
err << "Got the expected I/O failure: \"" << f.what() << "\".\n";
BOOST_CHECK( output.exceptions() == ios_base::goodbit );
@ -243,7 +250,11 @@ saver_tests_2
BOOST_ERROR( "previous line should have thrown" );
}
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
catch ( std::exception &f )
#else
catch ( ios_base::failure &f )
#endif
{
err << "Got the expected I/O failure: \"" << f.what() << "\".\n";
BOOST_CHECK( output.exceptions() == ios_base::goodbit );

View File

@ -9,6 +9,7 @@
// Revision History
// 12 Sep 2003 Initial version (Daryle Walker)
#include <boost/config.hpp>
#include <boost/io/ios_state.hpp> // for boost::io::ios_flags_saver, etc.
#include <boost/test/unit_test.hpp> // for main, BOOST_CHECK, etc.
@ -19,6 +20,9 @@
#include <istream> // for std::iostream
#include <locale> // for std::locale, std::numpunct
#include <sstream> // for std::stringstream, etc.
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
#include <stdexcept>
#endif
// Global constants
@ -226,9 +230,14 @@ ios_exception_saver_unit_test
{
boost::io::ios_iostate_saver iis( ss );
ss.exceptions( ios_base::failbit | ios_base::badbit );
char c;
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
BOOST_CHECK_THROW( ss >> c, std::exception );
#else
BOOST_CHECK_THROW( ss >> c, std::ios_base::failure );
#endif
}
}
@ -575,9 +584,14 @@ ios_all_saver_unit_test
{
boost::io::ios_iostate_saver iis( ss );
ss.exceptions( ios_base::failbit | ios_base::badbit );
char c;
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
BOOST_CHECK_THROW( ss >> c, std::exception );
#else
BOOST_CHECK_THROW( ss >> c, std::ios_base::failure );
#endif
}
ss.tie( &clog );
@ -639,14 +653,14 @@ ios_word_saver_unit_test
// Unit test program
boost::unit_test_framework::test_suite *
boost::unit_test::test_suite *
init_unit_test_suite
(
int , // "argc" is unused
char * [] // "argv" is unused
)
{
boost::unit_test_framework::test_suite * test
boost::unit_test::test_suite * test
= BOOST_TEST_SUITE( "I/O state saver test" );
test->add( BOOST_TEST_CASE(ios_flags_saver_unit_test) );