lib/upnp/Util: remove unused function stringToTokens()

This commit is contained in:
Max Kellermann 2020-03-13 17:59:07 +01:00
parent 569773cc75
commit d4135935e4
2 changed files with 0 additions and 41 deletions

View File

@ -66,37 +66,3 @@ path_getfather(const std::string &s) noexcept
path_catslash(father);
return father;
}
std::list<std::string>
stringToTokens(const std::string &str,
const char delim) noexcept
{
std::list<std::string> tokens;
std::string::size_type startPos = str.find_first_not_of(delim, 0);
// Skip initial delims, return empty if this eats all.
if (startPos == std::string::npos)
return tokens;
while (startPos < str.size()) {
// Find next delimiter or end of string (end of token)
auto pos = str.find_first_of(delim, startPos);
// Add token to the vector and adjust start
if (pos == std::string::npos) {
tokens.emplace_back(str, startPos);
break;
} else if (pos == startPos) {
// Dont' push empty tokens after first
if (tokens.empty())
tokens.emplace_back();
startPos = ++pos;
} else {
tokens.emplace_back(str, startPos, pos - startPos);
startPos = ++pos;
}
}
return tokens;
}

View File

@ -20,10 +20,7 @@
#ifndef MPD_UPNP_UTIL_HXX
#define MPD_UPNP_UTIL_HXX
#include "util/Compiler.h"
#include <string>
#include <list>
void
trimstring(std::string &s, const char *ws = " \t\n") noexcept;
@ -31,8 +28,4 @@ trimstring(std::string &s, const char *ws = " \t\n") noexcept;
std::string
path_getfather(const std::string &s) noexcept;
gcc_pure
std::list<std::string>
stringToTokens(const std::string &str, char delim) noexcept;
#endif /* _UPNPP_H_X_INCLUDED_ */