diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-28 21:52:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-28 21:52:49 +0300 |
commit | a9345c0e74408538488b0a329202ce611a4a0072 (patch) | |
tree | 9e8df5b62f4337286f4785fa7b62a3b256b81b57 /src/utils | |
parent | 1d5e1e10214b2f992888045dc750c8d8b7937b21 (diff) | |
download | mv-a9345c0e74408538488b0a329202ce611a4a0072.tar.gz mv-a9345c0e74408538488b0a329202ce611a4a0072.tar.bz2 mv-a9345c0e74408538488b0a329202ce611a4a0072.tar.xz mv-a9345c0e74408538488b0a329202ce611a4a0072.zip |
Add support for auto download content fixes.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/stringutils.cpp | 8 | ||||
-rw-r--r-- | src/utils/stringutils.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 361bc860c..176c5499c 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -578,3 +578,11 @@ bool findCutFirst(std::string &str1, std::string str2) } return false; } + +std::string &removeProtocol(std::string &url) +{ + int i = url.find("://"); + if (i != (int)std::string::npos) + url = url.substr(i + 3); + return url; +} diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index c0457bc52..25fe11e2d 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -201,4 +201,6 @@ bool findCutLast(std::string &str1, std::string str2); bool findCutFirst(std::string &str1, std::string str2); +std::string &removeProtocol(std::string &url); + #endif // UTILS_STRINGUTILS_H |