]> git.sesse.net Git - casparcg/blobdiff - common/param.h
[ffmpeg] Ported 2.0.7 ffmpeg producer to 2.1.0 while still keeping the usage of the...
[casparcg] / common / param.h
index 78d23c2071ed13b5423720dccdbd8523bccbe0eb..2a0f63224b81277d30f8ad909c8744fd76e42265 100644 (file)
@@ -31,6 +31,25 @@ void replace_placeholders(const std::wstring& placeholder, const std::wstring& r
                boost::ireplace_all(param, placeholder, replacement);
 }
 
+static std::vector<std::wstring> protocol_split(const std::wstring& s)
+{
+       std::vector<std::wstring> result;
+       size_t pos;
+
+       if ((pos = s.find(L"://")) != std::wstring::npos)
+       {
+               result.push_back(s.substr(0, pos));
+               result.push_back(s.substr(pos + 3));
+       }
+       else
+       {
+               result.push_back(L"");
+               result.push_back(s);
+       }
+
+       return result;
+}
+
 template<typename T, typename C>
 typename std::enable_if<!std::is_convertible<T, std::wstring>::value, typename std::decay<T>::type>::type get_param(const std::wstring& name, C&& params, T fail_value = T())
 {