Browse Source

getProtocolFromURL => getSchemeFromURL

pull/2/head
Odilitime 5 years ago
parent
commit
ab26144276
  1. 4
      src/StringUtils.cpp
  2. 5
      src/StringUtils.h

4
src/StringUtils.cpp

@ -57,11 +57,11 @@ const std::string getHostFromURL(const std::string &url) { @@ -57,11 +57,11 @@ const std::string getHostFromURL(const std::string &url) {
}
/**
* get protocol from a url
* get scheme from a url
* @param url url string
* @return '' or a string with the found protocol
*/
const std::string getProtocolFromURL(const std::string &url) {
const std::string getSchemeFromURL(const std::string &url) {
auto colonDoubleSlash = url.find("://");
if (colonDoubleSlash != std::string::npos) {
return url.substr(0, colonDoubleSlash);

5
src/StringUtils.h

@ -2,11 +2,12 @@ @@ -2,11 +2,12 @@
#define STRINGUTILS_H
#include <string>
const std::string toLowercase(const std::string &str);
// should be moved to URL
const std::string getFilenameExtension(std::string const& fileName);
const std::string getDocumentFromURL(const std::string &url);
const std::string getHostFromURL(const std::string &url);
const std::string getProtocolFromURL(const std::string &url);
const std::string toLowercase(const std::string &str);
const std::string getSchemeFromURL(const std::string &url);
#endif

Loading…
Cancel
Save