CStdString URLEncodeInline(const CStdString& strData)
{
CStdString buffer = strData;
- CURL::Encode(buffer);
+ buffer = CURL::Encode(buffer);
return buffer;
}
if (!(s.st_mode & S_IFDIR))
#endif
{
- Encode(archiveName);
+ archiveName = Encode(archiveName);
if (is_apk)
{
CURL c("apk://" + archiveName + "/" + strURL.substr(iPos + 1));
strURLData = strResult;
}
-void CURL::Encode(CStdString& strURLData)
+std::string CURL::Encode(const std::string& strURLData)
{
- CStdString strResult;
+ std::string strResult;
/* wonder what a good value is here is, depends on how often it occurs */
strResult.reserve( strURLData.length() * 2 );
strResult += strTmp;
}
}
- strURLData = strResult;
+
+ return strResult;
}
std::string CURL::Decode(const std::string& strURLData)
return url;
}
-std::string CURL::Encode(const std::string& strURLData)
-{
- CStdString url = strURLData;
- Encode(url);
- return url;
-}
-
CStdString CURL::TranslateProtocol(const CStdString& prot)
{
if (prot == "shout"
static bool IsFileOnly(const CStdString &url); ///< return true if there are no directories in the url.
static bool IsFullPath(const CStdString &url); ///< return true if the url includes the full path
static void Decode(CStdString& strURLData);
- static void Encode(CStdString& strURLData);
static std::string Decode(const std::string& strURLData);
static std::string Encode(const std::string& strURLData);
static CStdString TranslateProtocol(const CStdString& prot);
else
((CGUIButtonControl*) control)->SetLabel2(value);
if (bEncoded)
- CURL::Encode(value);
+ value = CURL::Encode(value);
}
}
else if (strcmp(type, "number") == 0 && CGUIDialogNumeric::ShowAndGetNumber(value, label))
vector<CStdString> vcsIn(1);
g_charsetConverter.utf8To(SearchStringEncoding(), sTitle, vcsIn[0]);
- CURL::Encode(vcsIn[0]);
+ vcsIn[0] = CURL::Encode(vcsIn[0]);
if (!sYear.empty())
vcsIn.push_back(sYear);
std::vector<CStdString> extras(2);
g_charsetConverter.utf8To(SearchStringEncoding(), sAlbum, extras[0]);
g_charsetConverter.utf8To(SearchStringEncoding(), sArtist, extras[1]);
- CURL::Encode(extras[0]);
- CURL::Encode(extras[1]);
+ extras[0] = CURL::Encode(extras[0]);
+ extras[1] = CURL::Encode(extras[1]);
CScraperUrl scurl;
vector<CStdString> vcsOut = RunNoThrow("CreateAlbumSearchUrl", scurl, fcurl, &extras);
if (vcsOut.size() > 1)
// returns an XML <url> element parseable by CScraperUrl
std::vector<CStdString> extras(1);
g_charsetConverter.utf8To(SearchStringEncoding(), sArtist, extras[0]);
- CURL::Encode(extras[0]);
+ extras[0] = CURL::Encode(extras[0]);
CScraperUrl scurl;
vector<CStdString> vcsOut = RunNoThrow("CreateArtistSearchUrl", scurl, fcurl, &extras);
// pass in the original search string for chaining to search other sites
vector<CStdString> vcIn;
vcIn.push_back(sSearch);
- CURL::Encode(vcIn[0]);
+ vcIn[0] = CURL::Encode(vcIn[0]);
vector<CStdString> vcsOut = RunNoThrow("GetArtistDetails", scurl, fcurl, &vcIn);
CStdString URLEncode(const CStdString value)
{
CStdString encoded(value);
- CURL::Encode(encoded);
+ encoded = CURL::Encode(encoded);
return encoded;
}
filename += "/";
partial = *it;
- CURL::Encode(partial);
+ partial = CURL::Encode(partial);
filename += partial;
}
CStdString strPath1 = strPath;
URIUtils::AddSlashAtEnd(strMultiPath);
//CLog::Log(LOGDEBUG, "-- adding path: %s", strPath.c_str());
- CURL::Encode(strPath1);
+ strPath1 = CURL::Encode(strPath1);
strMultiPath += strPath1;
strMultiPath += "/";
}
// add a new session to our buffer
CStdString user = origin.username;
- CURL::Encode(user);
+ user = CURL::Encode(user);
CStdString path = StringUtils::Format("sap://%s/%s/0x%x.sdp", header.origin.c_str(), desc.origin.c_str(), header.msgid);
CSession session;
session.path = path;
CStdString CSMBDirectory::GetMountPoint(const CStdString &strType, const CStdString &strName)
{
CStdString strPath = strType + strName;
- CURL::Encode(strPath);
+ strPath = CURL::Encode(strPath);
#if defined(TARGET_DARWIN)
CStdString str = getenv("HOME");
CStdString CSMB::URLEncode(const CStdString &value)
{
CStdString encoded(value);
- CURL::Encode(encoded);
+ encoded = CURL::Encode(encoded);
return encoded;
}
strStackTitle = Title1 + Ignore1 + Extension1;
// Check if source path uses URL encoding
if (URIUtils::ProtocolHasEncodedFilename(CURL(strCommonDir).GetProtocol()))
- CURL::Encode(strStackTitle);
+ strStackTitle = CURL::Encode(strStackTitle);
itRegExp = RegExps.end();
break;
else
id = (const char*) (*entry)->m_ReferenceID;
- CURL::Encode(id);
+ id = CURL::Encode(id);
URIUtils::AddSlashAtEnd(id);
pItem->SetPath(CStdString((const char*) "upnp://" + uuid + "/" + id.c_str()));
CURL url;
url.SetProtocol("zeroconf");
CStdString service_path = CZeroconfBrowser::ZeroconfService::toPath(*it);
- CURL::Encode(service_path);
+ service_path = CURL::Encode(service_path);
url.SetFileName(service_path);
item->SetPath(url.Get());
void CGUIWindowMusicNav::OnSearchUpdate()
{
CStdString search(GetProperty("search").asString());
- CURL::Encode(search);
+ search = CURL::Encode(search);
if (!search.empty())
{
CStdString path = "musicsearch://" + search + "/";
if (status != AIRPLAY_STATUS_NEED_AUTH)
{
CStdString userAgent="AppleCoreMedia/1.0.0.8F455 (AppleTV; U; CPU OS 4_3 like Mac OS X; de_de)";
- CURL::Encode(userAgent);
+ userAgent = CURL::Encode(userAgent);
location += "|User-Agent=" + userAgent;
CFileItem fileToPlay(location, false);
url = "image/";
else
url = "vfs/";
- CURL::Encode(strPath);
+ strPath = CURL::Encode(strPath);
url += strPath;
details["path"] = url;
return true;
NPT_String path = "upnp://"+device->GetUUID()+"/";
if (!NPT_StringsEqual(item_id, "0")) {
CStdString id = item_id;
- CURL::Encode(id);
+ id = CURL::Encode(id);
URIUtils::AddSlashAtEnd(id);
path += id.c_str();
}
else
filename = URIUtils::GetFileName(file_path);
- CURL::Encode(filename);
+ filename = CURL::Encode(filename);
md5state.append(file_path);
md5state.getDigest(md5);
md5 += "/" + filename;
if ((i2 = strDirty.find("!!!ENCODE!!!",i+12)) != std::string::npos)
{
strBuffer = strDirty.substr(i+12,i2-i-12);
- CURL::Encode(strBuffer);
+ strBuffer = CURL::Encode(strBuffer);
strDirty.replace(i, i2-i+12, strBuffer);
i += strBuffer.size();
}
if (entry.m_spoof.empty())
return entry.m_url;
CStdString spoof = entry.m_spoof;
- CURL::Encode(spoof);
+ spoof = CURL::Encode(spoof);
return entry.m_url + "|Referer=" + spoof;
}
if( !strPwd.empty() )
{
strBuffer = strPwd;
- CURL::Encode(strBuffer);
+ strBuffer = CURL::Encode(strBuffer);
strUrlPath += strBuffer;
strUrlPath += "@";
}
strBuffer = strArchivePath;
- CURL::Encode(strBuffer);
+ strBuffer = CURL::Encode(strBuffer);
strUrlPath += strBuffer;
#if 0 // options are not used
strBuffer = strCachePath;
- CURL::Encode(strBuffer);
+ strBuffer = CURL::Encode(strBuffer);
strUrlPath += "?cache=";
strUrlPath += strBuffer;