mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-22 12:34:24 +00:00
missing function. thanks jpfox
This commit is contained in:
parent
f3b9fc3148
commit
1e577bfdfb
@ -231,7 +231,6 @@ data_error:
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void findAndHexcape(libtorrent::entry &e, string const& key)
|
void findAndHexcape(libtorrent::entry &e, string const& key)
|
||||||
{
|
{
|
||||||
if( e.type() == libtorrent::entry::dictionary_t &&
|
if( e.type() == libtorrent::entry::dictionary_t &&
|
||||||
@ -329,4 +328,13 @@ void unHexcapeDht(libtorrent::entry &e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string safeGetEntryString(libtorrent::entry &e, std::string const& key)
|
||||||
|
{
|
||||||
|
if( e.type() == libtorrent::entry::dictionary_t &&
|
||||||
|
e.find_key(key) && e[key].type() == libtorrent::entry::string_t ) {
|
||||||
|
return e[key].string();
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -44,4 +44,6 @@ void unHexcapePost(libtorrent::entry &e);
|
|||||||
void hexcapeDht(libtorrent::entry &e);
|
void hexcapeDht(libtorrent::entry &e);
|
||||||
void unHexcapeDht(libtorrent::entry &e);
|
void unHexcapeDht(libtorrent::entry &e);
|
||||||
|
|
||||||
|
std::string safeGetEntryString(libtorrent::entry &e, std::string const& key);
|
||||||
|
|
||||||
#endif // TWISTER_UTILS_H
|
#endif // TWISTER_UTILS_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user