A thread-safe database of partfiles.
More...
#include <filesdb.hpp>
|
| | FilesDB ()=default |
| |
| | ~FilesDB ()=default |
| |
| | FilesDB (const FilesDB &)=delete |
| |
| FilesDB & | operator= (const FilesDB &)=delete |
| |
| | FilesDB (FilesDB &&)=delete |
| |
| bool | add_partfile (const std::string &group_id, std::shared_ptr< FileInfo > file_info, const std::string &file_path, bool all_downloaded) |
| | Add a partfile to the database.
|
| |
| bool | remove_partfile (const std::string &group_id, const std::string &file_name) |
| | Remove a partfile from the database.
|
| |
| PartFile | get_partfile (const std::string &group_id, const std::string &file_name) |
| |
| bool | has_file (const std::string &group_id, const std::string &file_name) |
| | Check if a partfile exists in the database.
|
| |
| bool | has_piece (const std::string &group_id, const std::string &file_name, const std::string &piece) |
| |
| bool | is_complete (const std::string &group_id, const std::string &file_name) |
| |
| bool | mark_downloaded (const std::string &group_id, const std::string &file_name, const std::string &piece) |
| |
A thread-safe database of partfiles.
◆ FilesDB() [1/3]
◆ ~FilesDB()
◆ FilesDB() [2/3]
| FilesDB::FilesDB |
( |
const FilesDB & | | ) |
|
|
delete |
◆ FilesDB() [3/3]
◆ add_partfile()
| bool FilesDB::add_partfile |
( |
const std::string & | group_id, |
|
|
std::shared_ptr< FileInfo > | file_info, |
|
|
const std::string & | file_path, |
|
|
bool | all_downloaded ) |
Add a partfile to the database.
- Returns
- true If the partfile was added successfully.
-
false If the partfile was not added successfully.
◆ get_partfile()
| PartFile FilesDB::get_partfile |
( |
const std::string & | group_id, |
|
|
const std::string & | file_name ) |
◆ has_file()
| bool FilesDB::has_file |
( |
const std::string & | group_id, |
|
|
const std::string & | file_name ) |
Check if a partfile exists in the database.
◆ has_piece()
| bool FilesDB::has_piece |
( |
const std::string & | group_id, |
|
|
const std::string & | file_name, |
|
|
const std::string & | piece ) |
◆ is_complete()
| bool FilesDB::is_complete |
( |
const std::string & | group_id, |
|
|
const std::string & | file_name ) |
◆ mark_downloaded()
| bool FilesDB::mark_downloaded |
( |
const std::string & | group_id, |
|
|
const std::string & | file_name, |
|
|
const std::string & | piece ) |
◆ operator=()
◆ remove_partfile()
| bool FilesDB::remove_partfile |
( |
const std::string & | group_id, |
|
|
const std::string & | file_name ) |
Remove a partfile from the database.
- Returns
- true If the partfile was removed successfully.
-
false If the partfile was not removed successfully.
The documentation for this class was generated from the following files: