removed the last dependency on iostream and lexical cast

This commit is contained in:
Arvid Norberg
2009-08-25 18:13:46 +00:00
parent 8c4cf8bffa
commit 6078dd06b0
18 changed files with 39 additions and 28 deletions

View File

@@ -240,6 +240,21 @@ namespace libtorrent
return false;
}
std::string read_until(char const*& str, char delim, char const* end)
{
TORRENT_ASSERT(str <= end);
std::string ret;
while (str != end && *str != delim)
{
ret += *str;
++str;
}
// skip the delimiter as well
while (str != end && *str == delim) ++str;
return ret;
}
std::string maybe_url_encode(std::string const& url)
{
std::string protocol, host, auth, path;