diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-04-15 13:41:38 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-04-15 13:41:38 +0100 |
commit | f3e2dd7780bb90feff6b2f7a36797752a4933ff6 (patch) | |
tree | 70b494839b379ab96cae33b01ae9ef6c1e893340 /site | |
parent | Add a redirect to work as a Gentoo mirror (diff) | |
download | mirrorsearch-f3e2dd7780bb90feff6b2f7a36797752a4933ff6.tar.bz2 mirrorsearch-f3e2dd7780bb90feff6b2f7a36797752a4933ff6.tar.xz mirrorsearch-f3e2dd7780bb90feff6b2f7a36797752a4933ff6.zip |
C++17 and Ice 3.7
Updates all components to be C++17 and Ice 3.7
Diffstat (limited to 'site')
-rw-r--r-- | site/Jamfile.jam | 6 | ||||
-rw-r--r-- | site/custom.cpp | 5 | ||||
-rw-r--r-- | site/test.cpp | 11 |
3 files changed, 10 insertions, 12 deletions
diff --git a/site/Jamfile.jam b/site/Jamfile.jam index 7bdba93..51a2f98 100644 --- a/site/Jamfile.jam +++ b/site/Jamfile.jam @@ -6,8 +6,6 @@ lib icespider-common ; lib icespider-fcgi ; lib icespider-testing ; lib adhocutil ; -lib Ice ; -lib IceUtil ; lib pthread ; lib boost_system ; lib boost_filesystem ; @@ -24,12 +22,10 @@ lib icespider : : <include>/usr/share/icespider/ice <library>icespider-common <library>adhocutil - <library>Ice - <library>IceUtil + <library>..//Ice <library>pthread <library>slicer <library>boost_system - <allow-ice>yes ; alias mirrorsearchsite : diff --git a/site/custom.cpp b/site/custom.cpp index 35d0d40..5d955a2 100644 --- a/site/custom.cpp +++ b/site/custom.cpp @@ -1,6 +1,7 @@ #include "icespider-routes-search.h" namespace MirrorSearch { + using namespace std::literals; // Implementation classes. // Route name: download @@ -19,13 +20,13 @@ namespace MirrorSearch { auto _p_filename(request->getURLParam<::std::string>(_pi_filename)); auto _responseModel = prx0->feelingLucky(_p_filename, request->getContext()); if (_responseModel) { - request->responseRedirect(*_responseModel, "Mirror found"); + request->responseRedirect(*_responseModel, "Mirror found"s); } request->response(404, "No mirror found"); } private: - const MirrorSearch::SearchPrx prx0; + const MirrorSearch::SearchPrxPtr prx0; const unsigned int _pi_filename; }; diff --git a/site/test.cpp b/site/test.cpp index ab71f83..4cd9763 100644 --- a/site/test.cpp +++ b/site/test.cpp @@ -6,6 +6,7 @@ #include <api.h> #include <Ice/ObjectAdapter.h> +#include <Ice/Initialize.h> using namespace IceSpider; using namespace MirrorSearch; @@ -16,18 +17,18 @@ class TestSerice : public Search { { return {}; } - virtual SearchHits getMatches(const ::std::string & fn, const ::Ice::Current& = ::Ice::Current()) override + virtual SearchHits getMatches(const ::std::string fn, const ::Ice::Current& = ::Ice::Current()) override { BOOST_TEST_INFO(fn); if (fn == "good.txt") { return { - new SearchHit(1, 1, "file:///some/file/path"), - new SearchHit(1, 1, "file:///some/other/path") + std::make_shared<SearchHit>(1, 1, "file:///some/file/path"), + std::make_shared<SearchHit>(1, 1, "file:///some/other/path") }; } return {}; } - virtual ::IceUtil::Optional<::std::string> feelingLucky(const ::std::string & fn, const ::Ice::Current & c = ::Ice::Current()) override + virtual ::Ice::optional<::std::string> feelingLucky(const ::std::string fn, const ::Ice::Current & c = ::Ice::Current()) override { auto ms = getMatches(fn, c); if (ms.empty()) { @@ -47,7 +48,7 @@ class TestApp : public CoreWithDefaultRouter { adp(communicator->createObjectAdapterWithEndpoints("test", "default")) { adp->activate(); - adp->add(new TestSerice(), communicator->stringToIdentity("Search")); + adp->add(std::make_shared<TestSerice>(), Ice::stringToIdentity("Search")); } ~TestApp() |