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

Perl Whore whoreperl at gmail.com
Sat Jun 19 04:45:33 UTC 2010


Nevermind, I got it done with Boost.Regex.

On Sat, Jun 19, 2010 at 5:10 AM, Perl Whore <whoreperl at gmail.com> wrote:

> 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/c3ca8c4a/attachment.html>


More information about the Libtorrent-devel mailing list