@@ -297,7 +297,7 @@ void CcdbApi::updateMetaInformationInLocalFile(std::string const& filename, std:
297297 */
298298std::string sanitizeObjectName (const std::string& objectName)
299299{
300- string tmpObjectName = objectName;
300+ std:: string tmpObjectName = objectName;
301301 tmpObjectName.erase (std::remove_if (tmpObjectName.begin (), tmpObjectName.end (),
302302 [](auto const & c) -> bool { return (!std::isalnum (c) && c != ' _' && c != ' /' && c != ' .' ); }),
303303 tmpObjectName.end ());
@@ -431,7 +431,7 @@ int CcdbApi::storeAsBinaryFile(const char* buffer, size_t size, const std::strin
431431 CURLcode res = CURL_LAST;
432432
433433 for (size_t hostIndex = 0 ; hostIndex < hostsPool.size () && res > 0 ; hostIndex++) {
434- string fullUrl = getFullUrlForStorage (curl, path, objectType, metadata, sanitizedStartValidityTimestamp, sanitizedEndValidityTimestamp, hostIndex);
434+ std:: string fullUrl = getFullUrlForStorage (curl, path, objectType, metadata, sanitizedStartValidityTimestamp, sanitizedEndValidityTimestamp, hostIndex);
435435 LOG (debug3) << " Full URL Encoded: " << fullUrl;
436436 /* what URL that receives this POST */
437437 curl_easy_setopt (curl, CURLOPT_URL, fullUrl.c_str ());
@@ -476,57 +476,57 @@ int CcdbApi::storeAsTFile(const TObject* rootObject, std::string const& path, st
476476 return storeAsBinaryFile (img->data (), img->size (), info.getFileName (), info.getObjectType (), path, metadata, startValidityTimestamp, endValidityTimestamp, maxSize);
477477}
478478
479- string CcdbApi::getFullUrlForStorage (CURL* curl, const string& path, const string& objtype,
480- const map<string, string>& metadata,
481- long startValidityTimestamp, long endValidityTimestamp, int hostIndex) const
479+ std:: string CcdbApi::getFullUrlForStorage (CURL* curl, const std:: string& path, const std:: string& objtype,
480+ const std:: map<std:: string, std:: string>& metadata,
481+ long startValidityTimestamp, long endValidityTimestamp, int hostIndex) const
482482{
483483 // Prepare timestamps
484- string startValidityString = getTimestampString (startValidityTimestamp < 0 ? getCurrentTimestamp () : startValidityTimestamp);
485- string endValidityString = getTimestampString (endValidityTimestamp < 0 ? getFutureTimestamp (60 * 60 * 24 * 1 ) : endValidityTimestamp);
484+ std:: string startValidityString = getTimestampString (startValidityTimestamp < 0 ? getCurrentTimestamp () : startValidityTimestamp);
485+ std:: string endValidityString = getTimestampString (endValidityTimestamp < 0 ? getFutureTimestamp (60 * 60 * 24 * 1 ) : endValidityTimestamp);
486486 // Get url
487- string url = getHostUrl (hostIndex);
487+ std:: string url = getHostUrl (hostIndex);
488488 // Build URL
489- string fullUrl = url + " /" + path + " /" + startValidityString + " /" + endValidityString + " /" ;
489+ std:: string fullUrl = url + " /" + path + " /" + startValidityString + " /" + endValidityString + " /" ;
490490 // Add type as part of metadata
491491 // we need to URL encode the object type, since in case it has special characters (like the "<", ">" for templated classes) it won't work otherwise
492492 char * objtypeEncoded = curl_easy_escape (curl, objtype.c_str (), objtype.size ());
493- fullUrl += " ObjectType=" + string (objtypeEncoded) + " /" ;
493+ fullUrl += " ObjectType=" + std:: string (objtypeEncoded) + " /" ;
494494 curl_free (objtypeEncoded);
495495 // Add general metadata
496496 for (auto & kv : metadata) {
497- string mfirst = kv.first ;
498- string msecond = kv.second ;
497+ std:: string mfirst = kv.first ;
498+ std:: string msecond = kv.second ;
499499 // same trick for the metadata as for the object type
500500 char * mfirstEncoded = curl_easy_escape (curl, mfirst.c_str (), mfirst.size ());
501501 char * msecondEncoded = curl_easy_escape (curl, msecond.c_str (), msecond.size ());
502- fullUrl += string (mfirstEncoded) + " =" + string (msecondEncoded) + " /" ;
502+ fullUrl += std:: string (mfirstEncoded) + " =" + std:: string (msecondEncoded) + " /" ;
503503 curl_free (mfirstEncoded);
504504 curl_free (msecondEncoded);
505505 }
506506 return fullUrl;
507507}
508508
509509// todo make a single method of the one above and below
510- string CcdbApi::getFullUrlForRetrieval (CURL* curl, const string& path, const map<string, string>& metadata, long timestamp, int hostIndex) const
510+ std:: string CcdbApi::getFullUrlForRetrieval (CURL* curl, const std:: string& path, const std:: map<std:: string, std:: string>& metadata, long timestamp, int hostIndex) const
511511{
512512 if (mInSnapshotMode ) {
513513 return getSnapshotFile (mSnapshotTopPath , path);
514514 }
515515
516516 // Prepare timestamps
517- string validityString = getTimestampString (timestamp < 0 ? getCurrentTimestamp () : timestamp);
517+ std:: string validityString = getTimestampString (timestamp < 0 ? getCurrentTimestamp () : timestamp);
518518 // Get host url
519- string hostUrl = getHostUrl (hostIndex);
519+ std:: string hostUrl = getHostUrl (hostIndex);
520520 // Build URL
521- string fullUrl = hostUrl + " /" + path + " /" + validityString + " /" ;
521+ std:: string fullUrl = hostUrl + " /" + path + " /" + validityString + " /" ;
522522 // Add metadata
523523 for (auto & kv : metadata) {
524- string mfirst = kv.first ;
525- string msecond = kv.second ;
524+ std:: string mfirst = kv.first ;
525+ std:: string msecond = kv.second ;
526526 // trick for the metadata in case it contains special characters
527527 char * mfirstEncoded = curl_easy_escape (curl, mfirst.c_str (), mfirst.size ());
528528 char * msecondEncoded = curl_easy_escape (curl, msecond.c_str (), msecond.size ());
529- fullUrl += string (mfirstEncoded) + " =" + string (msecondEncoded) + " /" ;
529+ fullUrl += std:: string (mfirstEncoded) + " =" + std:: string (msecondEncoded) + " /" ;
530530 curl_free (mfirstEncoded);
531531 curl_free (msecondEncoded);
532532 }
@@ -755,7 +755,7 @@ bool CcdbApi::receiveObject(void* dataHolder, std::string const& path, std::map<
755755 CURLcode curlResultCode = CURL_LAST;
756756
757757 for (size_t hostIndex = 0 ; hostIndex < hostsPool.size () && (responseCode >= 400 || curlResultCode > 0 ); hostIndex++) {
758- string fullUrl = getFullUrlForRetrieval (curlHandle, path, metadata, timestamp, hostIndex);
758+ std:: string fullUrl = getFullUrlForRetrieval (curlHandle, path, metadata, timestamp, hostIndex);
759759 curl_easy_setopt (curlHandle, CURLOPT_URL, fullUrl.c_str ());
760760
761761 curlResultCode = CURL_perform (curlHandle);
@@ -885,7 +885,7 @@ void CcdbApi::snapshot(std::string const& ccdbrootpath, std::string const& local
885885{
886886 // query all subpaths to ccdbrootpath
887887 const auto allfolders = getAllFolders (ccdbrootpath);
888- std::map<string, string> metadata;
888+ std::map<std:: string, std:: string> metadata;
889889 for (auto & folder : allfolders) {
890890 retrieveBlob (folder, localDir, metadata, timestamp);
891891 }
@@ -977,7 +977,7 @@ bool CcdbApi::initTGrid() const
977977 return gGrid != nullptr ;
978978}
979979
980- void * CcdbApi::downloadFilesystemContent (std::string const & url, std::type_info const & tinfo, std::map<string, string>* headers) const
980+ void * CcdbApi::downloadFilesystemContent (std::string const & url, std::type_info const & tinfo, std::map<std:: string, std:: string>* headers) const
981981{
982982 if ((url.find (" alien:/" , 0 ) != std::string::npos) && !initTGrid ()) {
983983 return nullptr ;
@@ -1016,7 +1016,7 @@ void* CcdbApi::interpretAsTMemFileAndExtract(char* contentptr, size_t contentsiz
10161016}
10171017
10181018// navigate sequence of URLs until TFile content is found; object is extracted and returned
1019- void * CcdbApi::navigateURLsAndRetrieveContent (CURL* curl_handle, std::string const & url, std::type_info const & tinfo, std::map<string, string>* headers) const
1019+ void * CcdbApi::navigateURLsAndRetrieveContent (CURL* curl_handle, std::string const & url, std::type_info const & tinfo, std::map<std:: string, std:: string>* headers) const
10201020{
10211021 // a global internal data structure that can be filled with HTTP header information
10221022 // static --> to avoid frequent alloc/dealloc as optimization
@@ -1164,7 +1164,7 @@ void* CcdbApi::retrieveFromTFile(std::type_info const& tinfo, std::string const&
11641164
11651165 CURL* curl_handle = curl_easy_init ();
11661166 curl_easy_setopt (curl_handle, CURLOPT_USERAGENT, mUniqueAgentID .c_str ());
1167- string fullUrl = getFullUrlForRetrieval (curl_handle, path, metadata, timestamp); // todo check if function still works correctly in case mInSnapshotMode
1167+ std:: string fullUrl = getFullUrlForRetrieval (curl_handle, path, metadata, timestamp); // todo check if function still works correctly in case mInSnapshotMode
11681168 // if we are in snapshot mode we can simply open the file; extract the object and return
11691169 if (mInSnapshotMode ) {
11701170 auto res = extractFromLocalFile (fullUrl, tinfo, headers);
@@ -1218,8 +1218,8 @@ std::string CcdbApi::list(std::string const& path, bool latestOnly, std::string
12181218 curl_easy_setopt (curl, CURLOPT_USERAGENT, mUniqueAgentID .c_str ());
12191219
12201220 struct curl_slist * headers = nullptr ;
1221- headers = curl_slist_append (headers, (string (" Accept: " ) + returnFormat).c_str ());
1222- headers = curl_slist_append (headers, (string (" Content-Type: " ) + returnFormat).c_str ());
1221+ headers = curl_slist_append (headers, (std:: string (" Accept: " ) + returnFormat).c_str ());
1222+ headers = curl_slist_append (headers, (std:: string (" Content-Type: " ) + returnFormat).c_str ());
12231223 if (createdNotAfter >= 0 ) {
12241224 headers = curl_slist_append (headers, (" If-Not-After: " + std::to_string (createdNotAfter)).c_str ());
12251225 }
@@ -1230,7 +1230,7 @@ std::string CcdbApi::list(std::string const& path, bool latestOnly, std::string
12301230
12311231 curlSetSSLOptions (curl);
12321232
1233- string fullUrl;
1233+ std:: string fullUrl;
12341234 // Perform the request, res will get the return code
12351235 for (size_t hostIndex = 0 ; hostIndex < hostsPool.size () && res != CURLE_OK; hostIndex++) {
12361236 fullUrl = getHostUrl (hostIndex);
@@ -1290,7 +1290,7 @@ void CcdbApi::truncate(std::string const& path) const
12901290 CURLcode res;
12911291 stringstream fullUrl;
12921292 for (size_t i = 0 ; i < hostsPool.size (); i++) {
1293- string url = getHostUrl (i);
1293+ std:: string url = getHostUrl (i);
12941294 fullUrl << url << " /truncate/" << path;
12951295
12961296 curl = curl_easy_init ();
@@ -1436,7 +1436,7 @@ std::map<std::string, std::string> CcdbApi::retrieveHeaders(std::string const& p
14361436 auto do_remote_header_call = [this , &path, &metadata, timestamp]() -> std::map<std::string, std::string> {
14371437 CURL* curl = curl_easy_init ();
14381438 CURLcode res = CURL_LAST;
1439- string fullUrl = getFullUrlForRetrieval (curl, path, metadata, timestamp);
1439+ std:: string fullUrl = getFullUrlForRetrieval (curl, path, metadata, timestamp);
14401440 std::map<std::string, std::string> headers;
14411441
14421442 if (curl != nullptr ) {
@@ -1632,12 +1632,12 @@ int CcdbApi::updateMetadata(std::string const& path, std::map<std::string, std::
16321632 fullUrl << " ?" ;
16331633
16341634 for (auto & kv : metadata) {
1635- string mfirst = kv.first ;
1636- string msecond = kv.second ;
1635+ std:: string mfirst = kv.first ;
1636+ std:: string msecond = kv.second ;
16371637 // same trick for the metadata as for the object type
16381638 char * mfirstEncoded = curl_easy_escape (curl, mfirst.c_str (), mfirst.size ());
16391639 char * msecondEncoded = curl_easy_escape (curl, msecond.c_str (), msecond.size ());
1640- fullUrl << string (mfirstEncoded) + " =" + string (msecondEncoded) + " &" ;
1640+ fullUrl << std:: string (mfirstEncoded) + " =" + std:: string (msecondEncoded) + " &" ;
16411641 curl_free (mfirstEncoded);
16421642 curl_free (msecondEncoded);
16431643 }
@@ -1728,7 +1728,7 @@ void CcdbApi::scheduleDownload(RequestContext& requestContext, size_t* requestCo
17281728
17291729 CURL* curl_handle = curl_easy_init ();
17301730 curl_easy_setopt (curl_handle, CURLOPT_USERAGENT, mUniqueAgentID .c_str ());
1731- string fullUrl = getFullUrlForRetrieval (curl_handle, requestContext.path , requestContext.metadata , requestContext.timestamp );
1731+ std:: string fullUrl = getFullUrlForRetrieval (curl_handle, requestContext.path , requestContext.metadata , requestContext.timestamp );
17321732 curl_slist* options_list = nullptr ;
17331733 initCurlHTTPHeaderOptionsForRetrieve (curl_handle, options_list, requestContext.timestamp , &requestContext.headers ,
17341734 requestContext.etag , requestContext.createdNotAfter , requestContext.createdNotBefore );
0 commit comments