10#ifndef SNBMODULES_INCLUDE_SNBMODULES_TRANSFER_METADATA_HPP_
11#define SNBMODULES_INCLUDE_SNBMODULES_TRANSFER_METADATA_HPP_
59 return m_file_path.string().compare(o.m_file_path.string());
73 const std::string& hash =
"",
75 const std::string& group_id =
"",
76 uint64_t bytes_transferred = 0,
87 {
"bytes_transferred",
true },
88 {
"transmission_speed",
true },
90 {
"magnet_link",
true },
91 {
"error_code",
true },
92 {
"start_time",
true },
94 {
"duration",
true } })
97 std::string file_path_str = file_path.string();
102 pos = file_path_str.find(x, pos);
103 if (pos == std::string::npos) {
107 file_path_str.replace(pos, x.length(),
"");
110 m_file_path = std::filesystem::absolute(file_path_str);
129 std::string file_path_str = file_path.string();
130 std::string x =
"./";
134 pos = file_path_str.find(x, pos);
135 if (pos == std::string::npos) {
139 file_path_str.replace(pos, x.length(),
"");
141 m_file_path = std::filesystem::absolute(file_path_str);
147 if (!(source ==
m_dest)) {
150 throw std::invalid_argument(
"The source cannot be equal to the destination");
157 if (!(dest ==
m_src)) {
160 throw std::invalid_argument(
"The destination cannot be equal to the source");
184 if (purcent < 0 || purcent > 100) {
185 throw std::invalid_argument(
"The progress must be between 0 and 100");
195 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
200 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
206 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
273 (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
288 std::tm tm = *std::localtime(&t);
289 std::stringstream ss;
290 ss << std::put_time(&tm,
"%d-%m-%Y %H:%M:%S");
299 std::tm tm = *std::localtime(&t);
300 std::stringstream ss;
301 ss << std::put_time(&tm,
"%d-%m-%Y %H:%M:%S");
350 {
"file_path",
false }, {
"hash",
false }, {
"bytes_size",
false },
351 {
"bytes_transferred",
false }, {
"status",
false }, {
"magnet_link",
false },
352 {
"group_id",
false }, {
"error_code",
false }, {
"transmission_speed",
false },
353 {
"start_time",
false }, {
"end_time",
false }, {
"duration",
false }
FELIX Initialization std::string initerror FELIX queue timed std::string queuename Unexpected chunk size
Cannot add TPSet with start_time
e_status
Different type of session status Need to be sorted by priority (highest last)