| alert_types.hpp | | alert_types.hpp | |
| | | | |
| skipping to change at line 404 | | skipping to change at line 404 | |
| | | | |
| virtual std::string message() const; | | virtual std::string message() const; | |
| | | | |
| // the new state of the torrent. | | // the new state of the torrent. | |
| torrent_status::state_t state; | | torrent_status::state_t state; | |
| | | | |
| // the previous state. | | // the previous state. | |
| torrent_status::state_t prev_state; | | torrent_status::state_t prev_state; | |
| }; | | }; | |
| | | | |
|
| // This alert is generated on tracker time outs, premature disconnec | | // This alert is generated on tracker time outs, premature disconnec | |
| ts, invalid response or | | ts, | |
| // a HTTP response other than "200 OK". From the alert you can get t | | // invalid response or a HTTP response other than "200 OK". From the | |
| he handle to the torrent | | alert | |
| // the tracker belongs to. | | // you can get the handle to the torrent the tracker belongs to. | |
| // | | // | |
|
| // The ``times_in_row`` member says how many times in a row this tra | | // The ``times_in_row`` member says how many times in a row this tra | |
| cker has failed. | | cker has | |
| // ``status_code`` is the code returned from the HTTP server. 401 me | | // failed. ``status_code`` is the code returned from the HTTP server | |
| ans the tracker needs | | . 401 | |
| // authentication, 404 means not found etc. If the tracker timed out | | // means the tracker needs authentication, 404 means not found etc. | |
| , the code will be set | | If the | |
| // to 0. | | // tracker timed out, the code will be set to 0. | |
| struct TORRENT_EXPORT tracker_error_alert: tracker_alert | | struct TORRENT_EXPORT tracker_error_alert: tracker_alert | |
| { | | { | |
| // internal | | // internal | |
| tracker_error_alert(torrent_handle const& h | | tracker_error_alert(torrent_handle const& h | |
| , int times | | , int times | |
| , int status | | , int status | |
| , std::string const& u | | , std::string const& u | |
| , error_code const& e | | , error_code const& e | |
| , std::string const& m) | | , std::string const& m) | |
| : tracker_alert(h, u) | | : tracker_alert(h, u) | |
| | | | |
| skipping to change at line 441 | | skipping to change at line 441 | |
| | | | |
| const static int static_category = alert::tracker_notificati
on | alert::error_notification; | | const static int static_category = alert::tracker_notificati
on | alert::error_notification; | |
| virtual std::string message() const; | | virtual std::string message() const; | |
| | | | |
| int times_in_row; | | int times_in_row; | |
| int status_code; | | int status_code; | |
| error_code error; | | error_code error; | |
| std::string msg; | | std::string msg; | |
| }; | | }; | |
| | | | |
|
| // This alert is triggered if the tracker reply contains a warning f | | // This alert is triggered if the tracker reply contains a warning f | |
| ield. Usually this | | ield. | |
| // means that the tracker announce was successful, but the tracker h | | // Usually this means that the tracker announce was successful, but | |
| as a message to | | the | |
| // the client. | | // tracker has a message to the client. | |
| struct TORRENT_EXPORT tracker_warning_alert: tracker_alert | | struct TORRENT_EXPORT tracker_warning_alert: tracker_alert | |
| { | | { | |
| // internal | | // internal | |
| tracker_warning_alert(torrent_handle const& h | | tracker_warning_alert(torrent_handle const& h | |
| , std::string const& u | | , std::string const& u | |
| , std::string const& m) | | , std::string const& m) | |
| : tracker_alert(h, u) | | : tracker_alert(h, u) | |
| , msg(m) | | , msg(m) | |
| { TORRENT_ASSERT(!url.empty()); } | | { TORRENT_ASSERT(!url.empty()); } | |
| | | | |
| | | | |
End of changes. 3 change blocks. |
| 17 lines changed or deleted | | 17 lines changed or added | |
|
| file_storage.hpp | | file_storage.hpp | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 108 | |
| // true if the file was marked as executable (posix) | | // true if the file was marked as executable (posix) | |
| bool executable_attribute:1; | | bool executable_attribute:1; | |
| | | | |
| // true if the file was a symlink. If this is the case | | // true if the file was a symlink. If this is the case | |
| // the ``symlink_index`` refers to a string which specifies
the original location | | // the ``symlink_index`` refers to a string which specifies
the original location | |
| // where the data for this file was found. | | // where the data for this file was found. | |
| bool symlink_attribute:1; | | bool symlink_attribute:1; | |
| }; | | }; | |
| | | | |
| // only export this type if deprecated functions are enabled | | // only export this type if deprecated functions are enabled | |
|
| #ifdef TORRENT_NO_DEPRECATED | | #ifdef TORRENT_NO_DEPRECATE | |
| #define TORRENT_DEPRECATED_EXPORT | | #define TORRENT_DEPRECATED_EXPORT | |
| #else | | #else | |
| #define TORRENT_DEPRECATED_EXPORT TORRENT_EXPORT | | #define TORRENT_DEPRECATED_EXPORT TORRENT_EXPORT | |
| #endif | | #endif | |
| | | | |
| // internal | | // internal | |
| struct TORRENT_DEPRECATED_EXPORT internal_file_entry | | struct TORRENT_DEPRECATED_EXPORT internal_file_entry | |
| { | | { | |
| friend class file_storage; | | friend class file_storage; | |
| #ifdef TORRENT_DEBUG | | #ifdef TORRENT_DEBUG | |
| | | | |
| skipping to change at line 239 | | skipping to change at line 239 | |
| // The ``file_storage`` class represents a file list and the piece | | // The ``file_storage`` class represents a file list and the piece | |
| // size. Everything necessary to interpret a regular bittorrent stor
age | | // size. Everything necessary to interpret a regular bittorrent stor
age | |
| // file structure. | | // file structure. | |
| class TORRENT_EXPORT file_storage | | class TORRENT_EXPORT file_storage | |
| { | | { | |
| friend class torrent_info; | | friend class torrent_info; | |
| public: | | public: | |
| // hidden | | // hidden | |
| file_storage(); | | file_storage(); | |
| // hidden | | // hidden | |
|
| ~file_storage() {} | | ~file_storage(); | |
| | | | |
| // returns true if the piece length has been initialized | | // returns true if the piece length has been initialized | |
| // on the file_storage. This is typically taken as a proxy | | // on the file_storage. This is typically taken as a proxy | |
| // of whether the file_storage as a whole is initialized or | | // of whether the file_storage as a whole is initialized or | |
| // not. | | // not. | |
| bool is_valid() const { return m_piece_length > 0; } | | bool is_valid() const { return m_piece_length > 0; } | |
| | | | |
| // file attribute flags | | // file attribute flags | |
| enum flags_t | | enum flags_t | |
| { | | { | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 272 | |
| // this file is a symbilic link. It should have a li
nk | | // this file is a symbilic link. It should have a li
nk | |
| // target string associated with it. | | // target string associated with it. | |
| attribute_symlink = 8 | | attribute_symlink = 8 | |
| }; | | }; | |
| | | | |
| // allocates space for ``num_files`` in the internal file li
st. This can | | // allocates space for ``num_files`` in the internal file li
st. This can | |
| // be used to avoid reallocating the internal file list when
the number | | // be used to avoid reallocating the internal file list when
the number | |
| // of files to be added is known up-front. | | // of files to be added is known up-front. | |
| void reserve(int num_files); | | void reserve(int num_files); | |
| | | | |
|
| // Adds a file to the file storage. The ``flags`` argument s | | // Adds a file to the file storage. The ``flags`` argument s | |
| ets attributes on the file. | | ets | |
| // The file attributes is an extension and may not work in a | | // attributes on the file. The file attributes is an extensi | |
| ll bittorrent clients. | | on and may | |
| | | // not work in all bittorrent clients. | |
| // | | // | |
| // For possible file attributes, see file_storage::flags_t. | | // For possible file attributes, see file_storage::flags_t. | |
| // | | // | |
|
| // If more files than one are added, certain restrictions to | | // If more files than one are added, certain restrictions to | |
| their paths apply. | | their paths | |
| // In a multi-file file storage (torrent), all files must sh | | // apply. In a multi-file file storage (torrent), all files | |
| are the same root directory. | | must share | |
| | | // the same root directory. | |
| // | | // | |
| // That is, the first path element of all files must be the
same. | | // That is, the first path element of all files must be the
same. | |
| // This shared path element is also set to the name of the t
orrent. It | | // This shared path element is also set to the name of the t
orrent. It | |
| // can be changed by calling ``set_name``. | | // can be changed by calling ``set_name``. | |
| // | | // | |
|
| // The built in functions to traverse a directory to add fil | | // The ``filehash`` argument is an optional pointer to a sha | |
| es will | | -1 hash (20 | |
| // make sure this requirement is fulfilled. | | // bytes) of the file. The hash is not copied into the file_ | |
| | | storage | |
| | | // object, but the pointer is expected to point to memory th | |
| | | at stays | |
| | | // valid throughout the life time of the file_storage. | |
| | | // | |
| | | // Currently, the ``filehash`` from ``file_entry`` is not us | |
| | | ed. | |
| void add_file(file_entry const& e, char const* filehash = 0)
; | | void add_file(file_entry const& e, char const* filehash = 0)
; | |
| void add_file(std::string const& p, size_type size, int flag
s = 0 | | void add_file(std::string const& p, size_type size, int flag
s = 0 | |
| , std::time_t mtime = 0, std::string const& s_p = ""
); | | , std::time_t mtime = 0, std::string const& s_p = ""
); | |
| | | | |
| // renames the file at ``index`` to ``new_filename``. Keep i
n mind | | // renames the file at ``index`` to ``new_filename``. Keep i
n mind | |
| // that filenames are expected to be UTF-8 encoded. | | // that filenames are expected to be UTF-8 encoded. | |
| void rename_file(int index, std::string const& new_filename)
; | | void rename_file(int index, std::string const& new_filename)
; | |
| | | | |
| // this is a low-level function that sets the name of a file | | // this is a low-level function that sets the name of a file | |
| // by making it reference a buffer that is not owned by the
file_storage. | | // by making it reference a buffer that is not owned by the
file_storage. | |
| | | | |
| skipping to change at line 418 | | skipping to change at line 424 | |
| // default is to not add any padding (-1). The alignment spe
cifies the | | // default is to not add any padding (-1). The alignment spe
cifies the | |
| // alignment files should be padded to. This defaults to the
piece size | | // alignment files should be padded to. This defaults to the
piece size | |
| // (-1) but it may also make sense to set it to 16 kiB, or s
omething | | // (-1) but it may also make sense to set it to 16 kiB, or s
omething | |
| // divisible by 16 kiB. | | // divisible by 16 kiB. | |
| // If pad_file_limit is 0, every file will be padded (except
empty ones). | | // If pad_file_limit is 0, every file will be padded (except
empty ones). | |
| void optimize(int pad_file_limit = -1, int alignment = -1); | | void optimize(int pad_file_limit = -1, int alignment = -1); | |
| | | | |
| // These functions are used to query attributes of files at | | // These functions are used to query attributes of files at | |
| // a given index. | | // a given index. | |
| // | | // | |
|
| // The ``file_hash()`` is a sha-1 hash of the file, or 0 if
none was | | // The ``hash()`` is a sha-1 hash of the file, or 0 if none
was | |
| // provided in the torrent file. This can potentially be use
d to | | // provided in the torrent file. This can potentially be use
d to | |
| // join a bittorrent network with other file sharing network
s. | | // join a bittorrent network with other file sharing network
s. | |
| // | | // | |
| // The ``mtime()`` is the modification time is the posix | | // The ``mtime()`` is the modification time is the posix | |
| // time when a file was last modified when the torrent | | // time when a file was last modified when the torrent | |
| // was created, or 0 if it was not included in the torrent f
ile. | | // was created, or 0 if it was not included in the torrent f
ile. | |
| // | | // | |
| // ``file_path()`` returns the full path to a file. | | // ``file_path()`` returns the full path to a file. | |
| // | | // | |
| // ``file_size()`` returns the size of a file. | | // ``file_size()`` returns the size of a file. | |
| | | | |
End of changes. 6 change blocks. |
| 14 lines changed or deleted | | 23 lines changed or added | |
|
| torrent_handle.hpp | | torrent_handle.hpp | |
| | | | |
| skipping to change at line 970 | | skipping to change at line 970 | |
| // there are files in the torrent. Each entry is the priorit
y of that | | // there are files in the torrent. Each entry is the priorit
y of that | |
| // file. The function sets the priorities of all the pieces
in the | | // file. The function sets the priorities of all the pieces
in the | |
| // torrent based on the vector. | | // torrent based on the vector. | |
| // | | // | |
| // ``file_priorities()`` returns a vector with the prioritie
s of all | | // ``file_priorities()`` returns a vector with the prioritie
s of all | |
| // files. | | // files. | |
| // | | // | |
| // The priority values are the same as for piece_priority(). | | // The priority values are the same as for piece_priority(). | |
| // | | // | |
| // Whenever a file priority is changed, all other piece prio
rities are | | // Whenever a file priority is changed, all other piece prio
rities are | |
|
| // reset to match the file priorities. In order to maintain
sepcial | | // reset to match the file priorities. In order to maintain
special | |
| // priorities for particular pieces, piece_priority() has to
be called | | // priorities for particular pieces, piece_priority() has to
be called | |
| // again for those pieces. | | // again for those pieces. | |
| // | | // | |
| // You cannot set the file priorities on a torrent that does
not yet have | | // You cannot set the file priorities on a torrent that does
not yet have | |
| // metadata or a torrent that is a seed. ``file_priority(int
, int)`` and | | // metadata or a torrent that is a seed. ``file_priority(int
, int)`` and | |
| // prioritize_files() are both no-ops for such torrents. | | // prioritize_files() are both no-ops for such torrents. | |
| void file_priority(int index, int priority) const; | | void file_priority(int index, int priority) const; | |
| int file_priority(int index) const; | | int file_priority(int index) const; | |
| void prioritize_files(std::vector<int> const& files) const; | | void prioritize_files(std::vector<int> const& files) const; | |
| std::vector<int> file_priorities() const; | | std::vector<int> file_priorities() const; | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|