[Libtorrent-devel] Extracting the domain from the announce url

Perl Whore whoreperl at gmail.com
Fri Jun 18 23:40:00 UTC 2010


I'm making a few changes to the source so I can custom views based on the
tracker's domain without making use of external scripts.

I added this in src/command_ui.cc to enable a new command to_domain which
will return the domain when a url is passed to it.

*torrent::Object*
*apply_to_domain(const torrent::Object& rawArgs) {*

* const char * url = rawArgs.as_string().c_str();*
* char buffer[50];*
* snprintf(buffer, 50, "testing: you entered %s.", url);*

*  return std::string(buffer);*
*}*

Can someone help me with this? It's probably just one line I need to add. I
looked at rak/regex.h but I'm not sure how to use it.

P.S. This is my first time with C++
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rakshasa.no/pipermail/libtorrent-devel/attachments/20100619/593884dc/attachment.html>


More information about the Libtorrent-devel mailing list