mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 21:22:31 +00:00
* Added the framework for a download scheduler.
* Added "state_changed" variable to downloads that returns the last time the download called DownloadList::pause/resume. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@674 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+12
-2
@@ -55,21 +55,31 @@ namespace display {
|
||||
|
||||
char*
|
||||
print_string(char* first, char* last, char* str) {
|
||||
if (first == last)
|
||||
return first;
|
||||
|
||||
// We don't have any nice simple functions for copying strings that
|
||||
// return the end address.
|
||||
while (first != last && *str != '\0')
|
||||
while (first + 1 != last && *str != '\0')
|
||||
*(first++) = *(str++);
|
||||
|
||||
*first = '\0';
|
||||
|
||||
return first;
|
||||
}
|
||||
|
||||
char*
|
||||
print_hhmmss(char* first, char* last, time_t t) {
|
||||
return print_buffer(first, last, "%2d:%02d:%02d", (int)t / 3600, ((int)t / 60) % 60, (int)t % 60);
|
||||
}
|
||||
|
||||
char*
|
||||
print_hhmmss_local(char* first, char* last, time_t t) {
|
||||
std::tm *u = std::localtime(&t);
|
||||
|
||||
if (u == NULL)
|
||||
//return "inv_time";
|
||||
throw torrent::internal_error("print_hhmmss(...) failed.");
|
||||
throw torrent::internal_error("print_hhmmss_local(...) failed.");
|
||||
|
||||
return print_buffer(first, last, "%2u:%02u:%02u", u->tm_hour, u->tm_min, u->tm_sec);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user