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 /service/apiImpl.cpp | |
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 'service/apiImpl.cpp')
-rw-r--r-- | service/apiImpl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/service/apiImpl.cpp b/service/apiImpl.cpp index 42a7918..5a1e7a6 100644 --- a/service/apiImpl.cpp +++ b/service/apiImpl.cpp @@ -15,7 +15,7 @@ BOOST_VERIFY_MSG(CURLE_OK == curl_easy_setopt(curl.get(), opt, expr), "Failed setting option " #opt); namespace MirrorSearch { - SearchImpl::SearchImpl(IceTray::DatabasePoolPtr db) : + SearchImpl::SearchImpl(const DB::ConnectionPoolPtr & db) : IceTray::AbstractDatabaseClient(db), log(LOGMANAGER()->getLogger<SearchImpl>()) { @@ -65,7 +65,7 @@ namespace MirrorSearch { AdHocFormatter(Read, "Failed to read in %? (%?) [%?]"); UPtr<xmlDoc> getDoc(const SearchServicePtr & ss, const std::string & fn) { auto fmt = AdHoc::Buffer::getFormat(ss->baseurl); - auto url = (*fmt % fn).str(); + auto url = (fmt % fn).str(); char errbuf[CURL_ERROR_SIZE] = ""; xmlParserCtxtSPtr ctx { nullptr, nullptr }; @@ -137,17 +137,17 @@ namespace MirrorSearch { if (!xpathObj->nodesetval) { throw XmlError("Nodeset is null"); } - log->messagebf(LOG::INFO, "%d nodes matched %s", xpathObj->nodesetval->nodeNr, s->listxpath); + log->messagebf(LOG::LogLevel::INFO, "%d nodes matched %s", xpathObj->nodesetval->nodeNr, s->listxpath); for (int row = 0; row < xpathObj->nodesetval->nodeNr; row += 1) { xpathCtx->node = xpathObj->nodesetval->nodeTab[row]; auto xpathObjI = getXPathObj(s->urlxpath, xpathCtx, xmlXPathObjectType::XPATH_STRING); if (xpathObjI->stringval && *xpathObjI->stringval) { - sh.push_back(new SearchHit(0, s->id, (const char *) xpathObjI->stringval)); + sh.push_back(std::make_shared<SearchHit>(0, s->id, (const char *) xpathObjI->stringval)); } } } - SearchHits SearchImpl::getMatches(const ::std::string & fn, const ::Ice::Current & c) + SearchHits SearchImpl::getMatches(const ::std::string fn, const ::Ice::Current & c) { SearchHits sh; for (const auto & s : getServices(c)) { @@ -156,7 +156,7 @@ namespace MirrorSearch { return sh; } - ::IceUtil::Optional<::std::string> SearchImpl::feelingLucky(const ::std::string & fn, const ::Ice::Current & c) + ::IceUtil::Optional<::std::string> SearchImpl::feelingLucky(const ::std::string fn, const ::Ice::Current & c) { const auto ms = getMatches(fn, c); if (ms.empty()) |