From 019143fa57a51d41583271195b0712b7891034f8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 31 Aug 2015 17:22:40 +0100 Subject: Typedef the stream, not the source --- libadhocutil/curlStream.h | 2 +- libadhocutil/unittests/testCurl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libadhocutil/curlStream.h b/libadhocutil/curlStream.h index 74816a0..2528bd8 100644 --- a/libadhocutil/curlStream.h +++ b/libadhocutil/curlStream.h @@ -26,7 +26,7 @@ class DLL_PUBLIC CurlStreamSource : public boost::iostreams::source, public Curl CURLcode res; }; -typedef boost::reference_wrapper css_ref; +typedef boost::iostreams::stream> CurlStream; #endif diff --git a/libadhocutil/unittests/testCurl.cpp b/libadhocutil/unittests/testCurl.cpp index a62800d..7d447c8 100644 --- a/libadhocutil/unittests/testCurl.cpp +++ b/libadhocutil/unittests/testCurl.cpp @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE( fetch_file_stream ) { auto url = "file://" + rootDir.string() + "/testCurl.cpp"; CurlStreamSource css(url); - boost::iostreams::stream curlstrm(boost::ref(css)); + CurlStream curlstrm(css); std::string tok; curlstrm >> tok; BOOST_REQUIRE_EQUAL("#define", tok); @@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE( fetch_missing_stream ) auto url = "file://" + rootDir.string() + "/nothere"; BOOST_REQUIRE_THROW({ CurlStreamSource css(url); - boost::iostreams::stream curlstrm(boost::ref(css)); + CurlStream curlstrm(css); std::string tok; curlstrm >> tok; }, AdHoc::Net::CurlException); -- cgit v1.2.3