Furrent
Public Member Functions | Public Attributes | List of all members
fur::TorrentFile Struct Reference

Represents a parsed .torrent file. More...

#include <torrent.hpp>

Public Member Functions

 TorrentFile ()=default
 Construct an empty TorrentFile instance. More...
 
 TorrentFile (const bencode::BencodeValue &tree)
 

Public Attributes

std::string announce_url
 
hash::hash_t info_hash {}
 
std::vector< hash::hash_tpiece_hashes
 SHA1 hashes, one for each piece of the shared file. More...
 
int64_t piece_length = 0
 The length, in bytes, of each piece. More...
 
int64_t length = 0
 The length, in bytes, of the entire shared file. More...
 
int64_t pieces_count = 0
 Total number of pieces. More...
 
std::string name
 The name of the shared file. More...
 
std::string folder_name
 Name of the folder containing all torrent files. More...
 
std::vector< Filefiles
 Describe the structure of the file. More...
 

Detailed Description

Represents a parsed .torrent file.

Constructor & Destructor Documentation

◆ TorrentFile() [1/2]

fur::TorrentFile::TorrentFile ( )
explicitdefault

Construct an empty TorrentFile instance.

◆ TorrentFile() [2/2]

fur::TorrentFile::TorrentFile ( const bencode::BencodeValue tree)
explicit

Construct an instance of TorrentFile given a bencode::BencodeValue which is assumed to be the parsed .torrent file

Member Data Documentation

◆ announce_url

std::string fur::TorrentFile::announce_url

The URL used to announce ourselves to the tracker and fetch a list of peers

◆ files

std::vector<File> fur::TorrentFile::files

Describe the structure of the file.

◆ folder_name

std::string fur::TorrentFile::folder_name

Name of the folder containing all torrent files.

◆ info_hash

hash::hash_t fur::TorrentFile::info_hash {}

The SHA1 hash of the "info" dict from the decoded .torrent file. Uniquely identifies this torrent to the tracker and other peers

◆ length

int64_t fur::TorrentFile::length = 0

The length, in bytes, of the entire shared file.

◆ name

std::string fur::TorrentFile::name

The name of the shared file.

◆ piece_hashes

std::vector<hash::hash_t> fur::TorrentFile::piece_hashes

SHA1 hashes, one for each piece of the shared file.

◆ piece_length

int64_t fur::TorrentFile::piece_length = 0

The length, in bytes, of each piece.

◆ pieces_count

int64_t fur::TorrentFile::pieces_count = 0

Total number of pieces.


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