10#ifndef SNBMODULES_INCLUDE_SNBMODULES_TRANSFER_METADATA_HPP_
11#define SNBMODULES_INCLUDE_SNBMODULES_TRANSFER_METADATA_HPP_
63 return m_file_path.string().compare(o.m_file_path.string());
77 const std::string& hash =
"",
79 const std::string& group_id =
"",
80 uint64_t bytes_transferred = 0,
91 {
"bytes_transferred",
true },
92 {
"transmission_speed",
true },
94 {
"magnet_link",
true },
95 {
"error_code",
true },
96 {
"start_time",
true },
98 {
"duration",
true } })
101 std::string file_path_str = file_path.string();
102 std::string x =
"./";
106 pos = file_path_str.find(x, pos);
107 if (pos == std::string::npos) {
111 file_path_str.replace(pos, x.length(),
"");
114 m_file_path = std::filesystem::absolute(file_path_str);
133 std::string file_path_str = file_path.string();
134 std::string x =
"./";
138 pos = file_path_str.find(x, pos);
139 if (pos == std::string::npos) {
143 file_path_str.replace(pos, x.length(),
"");
145 m_file_path = std::filesystem::absolute(file_path_str);
151 if (!(source ==
m_dest)) {
154 throw std::invalid_argument(
"The source cannot be equal to the destination");
161 if (!(dest ==
m_src)) {
164 throw std::invalid_argument(
"The destination cannot be equal to the source");
188 if (purcent < 0 || purcent > 100) {
189 throw std::invalid_argument(
"The progress must be between 0 and 100");
199 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
204 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
210 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
277 (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
292 std::tm tm = *std::localtime(&t);
293 std::stringstream ss;
294 ss << std::put_time(&tm,
"%d-%m-%Y %H:%M:%S");
303 std::tm tm = *std::localtime(&t);
304 std::stringstream ss;
305 ss << std::put_time(&tm,
"%d-%m-%Y %H:%M:%S");
354 {
"file_path",
false }, {
"hash",
false }, {
"bytes_size",
false },
355 {
"bytes_transferred",
false }, {
"status",
false }, {
"magnet_link",
false },
356 {
"group_id",
false }, {
"error_code",
false }, {
"transmission_speed",
false },
357 {
"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)