Furrent
Classes | Public Types | Public Member Functions | List of all members
fur::Furrent Class Reference

#include <furrent.hpp>

Inheritance diagram for fur::Furrent:
Inheritance graph
[legend]
Collaboration diagram for fur::Furrent:
Collaboration graph
[legend]

Public Types

enum  Error { Error::GenericError, Error::LoadingTorrentFailed }
 All possible Furrent errors. More...
 
template<typename R >
using Result = util::Result< R, Error >
 Errors for the furrent class. More...
 
using Empty = util::Empty
 

Public Member Functions

 Furrent ()
 
virtual ~Furrent ()
 
Result< Emptyset_download_folder (const std::string &folder)
 Set the download folder. More...
 
Result< TorrentIDadd_torrent (const std::string &filename)
 Begin download of a torrent. More...
 
void remove_torrent (TorrentID tid)
 Removes a torrent descriptor and all of his tasks. More...
 
TorrentGuiData get_gui_data (TorrentID tid) const
 Extract torrents stats. More...
 
- Public Member Functions inherited from fur::util::Singleton< Furrent >
 Singleton ()=default
 
 Singleton (const Singleton &)=delete
 
 Singleton (Singleton &&) noexcept=delete
 
Singletonoperator= (const Singleton &)=delete
 
Singletonoperator= (Singleton &&) noexcept=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from fur::util::Singleton< Furrent >
static Furrentinstance ()
 Returns the instance of the singleton. More...
 

Detailed Description

Main state of the program NB: All added torrent handle descriptor will never be removed from memory!

Member Typedef Documentation

◆ Empty

◆ Result

template<typename R >
using fur::Furrent::Result = util::Result<R, Error>

Errors for the furrent class.

Member Enumeration Documentation

◆ Error

enum fur::Furrent::Error
strong

All possible Furrent errors.

Enumerator
GenericError 
LoadingTorrentFailed 

Constructor & Destructor Documentation

◆ Furrent()

fur::Furrent::Furrent ( )

This is the core of all workers

◆ ~Furrent()

fur::Furrent::~Furrent ( )
virtual

Member Function Documentation

◆ add_torrent()

auto fur::Furrent::add_torrent ( const std::string &  filename)

Begin download of a torrent.

Begin download of a torrent

Parameters
filenamefilename of the .torrent file
Returns
the id of the new torrent

◆ get_gui_data()

TorrentGuiData fur::Furrent::get_gui_data ( TorrentID  tid) const

Extract torrents stats.

◆ remove_torrent()

void fur::Furrent::remove_torrent ( TorrentID  tid)

Removes a torrent descriptor and all of his tasks.

Removes a torrent descriptor and all of his tasks

Parameters
uiduid of the torrent to remove

◆ set_download_folder()

auto fur::Furrent::set_download_folder ( const std::string &  folder)

Set the download folder.


The documentation for this class was generated from the following files: