2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Defined "OK", "ERR", "INPR" as static const std::string
	* src/RequestGroupMan.cc (showDownloadResults)
pull/1/head
Tatsuhiro Tsujikawa 2008-05-14 15:03:09 +00:00
parent 919c6934a8
commit 630cee3cb7
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Defined "OK", "ERR", "INPR" as static const std::string
* src/RequestGroupMan.cc (showDownloadResults)
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> 2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Defined default client used in extended handshake as static const Defined default client used in extended handshake as static const

View File

@ -248,6 +248,10 @@ RequestGroupMan::DownloadStat RequestGroupMan::getDownloadStat() const
void RequestGroupMan::showDownloadResults(std::ostream& o) const void RequestGroupMan::showDownloadResults(std::ostream& o) const
{ {
static const std::string MARK_OK("OK");
static const std::string MARK_ERR("ERR");
static const std::string MARK_INPR("INPR");
// Download Results: // Download Results:
// idx|stat|path/length // idx|stat|path/length
// ===+====+======================================================================= // ===+====+=======================================================================
@ -257,14 +261,14 @@ void RequestGroupMan::showDownloadResults(std::ostream& o) const
<< "===+====+======================================================================" << "\n"; << "===+====+======================================================================" << "\n";
for(std::deque<SharedHandle<DownloadResult> >::const_iterator itr = _downloadResults.begin(); for(std::deque<SharedHandle<DownloadResult> >::const_iterator itr = _downloadResults.begin();
itr != _downloadResults.end(); ++itr) { itr != _downloadResults.end(); ++itr) {
std::string status = (*itr)->result == DownloadResult::FINISHED ? "OK" : "ERR"; o << formatDownloadResult((*itr)->result == DownloadResult::FINISHED ?
o << formatDownloadResult(status, *itr) << "\n"; MARK_OK : MARK_ERR, *itr) << "\n";
} }
for(RequestGroups::const_iterator itr = _requestGroups.begin(); for(RequestGroups::const_iterator itr = _requestGroups.begin();
itr != _requestGroups.end(); ++itr) { itr != _requestGroups.end(); ++itr) {
DownloadResultHandle result = (*itr)->createDownloadResult(); DownloadResultHandle result = (*itr)->createDownloadResult();
std::string status = result->result == DownloadResult::FINISHED ? "OK" : "INPR"; o << formatDownloadResult(result->result == DownloadResult::FINISHED ?
o << formatDownloadResult(status, result) << "\n"; MARK_OK : MARK_INPR, result) << "\n";
} }
o << "\n" o << "\n"
<< _("Status Legend:") << "\n" << _("Status Legend:") << "\n"