added: URIUtils::ProtocolHasEncodedFilename() function
authorarnova <arnova@void.org>
Tue, 12 Jun 2012 17:50:27 +0000 (19:50 +0200)
committerarnova <arnova@void.org>
Sun, 1 Jul 2012 10:36:18 +0000 (12:36 +0200)
xbmc/utils/URIUtils.cpp
xbmc/utils/URIUtils.h

index 5ff3469..c662571 100644 (file)
@@ -241,6 +241,15 @@ bool URIUtils::ProtocolHasEncodedHostname(const CStdString& prot)
       || prot.Equals("musicsearch");
 }
 
+bool URIUtils::ProtocolHasEncodedFilename(const CStdString& prot)
+{
+  CStdString prot2 = CURL::TranslateProtocol(prot);
+
+  // For now assume only (quasi) http internet streams use URL encoding
+  return prot2 == "http"  ||
+         prot2 == "https";
+}
+
 CStdString URIUtils::GetParentPath(const CStdString& strPath)
 {
   CStdString strReturn;
@@ -661,7 +670,6 @@ bool URIUtils::IsFTP(const CStdString& strFile)
 
 bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */)
 {
-  
   CStdString strProtocol = url.GetProtocol();
   
   if (strProtocol.IsEmpty())
index 4eb1d93..656b6e7 100644 (file)
@@ -112,5 +112,6 @@ public:
 
   static bool ProtocolHasParentInHostname(const CStdString& prot);
   static bool ProtocolHasEncodedHostname(const CStdString& prot);
+  static bool ProtocolHasEncodedFilename(const CStdString& prot);
 };