summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-08-31 17:22:40 +0100
committerDan Goodliffe <daniel.goodliffe@pressassociation.com>2015-09-01 16:56:11 +0100
commit019143fa57a51d41583271195b0712b7891034f8 (patch)
treed70e18e1c04a61fc4070c6ecd5274f49a7cdbd3a
parentImprove misc.h compatibility by having the macro call .str() to maintain std:... (diff)
downloadlibadhocutil-019143fa57a51d41583271195b0712b7891034f8.tar.bz2
libadhocutil-019143fa57a51d41583271195b0712b7891034f8.tar.xz
libadhocutil-019143fa57a51d41583271195b0712b7891034f8.zip
Typedef the stream, not the source
-rw-r--r--libadhocutil/curlStream.h2
-rw-r--r--libadhocutil/unittests/testCurl.cpp4
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<CurlStreamSource> css_ref;
+typedef boost::iostreams::stream<boost::reference_wrapper<CurlStreamSource>> 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<css_ref> 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<css_ref> curlstrm(boost::ref(css));
+ CurlStream curlstrm(css);
std::string tok;
curlstrm >> tok;
}, AdHoc::Net::CurlException);