summaryrefslogtreecommitdiff
path: root/src/MessageDigestHelper.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-20 09:36:14 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-20 09:36:14 +0000
commit694fb307aa7e582a55bce7e995bde3a4614b3b4f (patch)
tree42bf3e703ebd706c9ebdd62bca59396f2d67a790 /src/MessageDigestHelper.cc
parent580098eb4929a3bdbf424af18da361259ef2efe5 (diff)
2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced StringFormat with fmt
Diffstat (limited to 'src/MessageDigestHelper.cc')
-rw-r--r--src/MessageDigestHelper.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/MessageDigestHelper.cc b/src/MessageDigestHelper.cc
index 93981068..ca51bea0 100644
--- a/src/MessageDigestHelper.cc
+++ b/src/MessageDigestHelper.cc
@@ -42,7 +42,7 @@
#include "message.h"
#include "DefaultDiskWriter.h"
#include "util.h"
-#include "StringFormat.h"
+#include "fmt.h"
namespace aria2 {
@@ -79,8 +79,7 @@ std::string MessageDigestHelper::hexDigest
for(uint64_t i = 0; i < iteration; ++i) {
ssize_t readLength = bs->readData(BUF, BUFSIZE, offset);
if((size_t)readLength != BUFSIZE) {
- throw DL_ABORT_EX
- (StringFormat(EX_FILE_READ, "n/a", "data is too short").str());
+ throw DL_ABORT_EX(fmt(EX_FILE_READ, "n/a", "data is too short"));
}
ctx->update(BUF, readLength);
offset += readLength;
@@ -88,8 +87,7 @@ std::string MessageDigestHelper::hexDigest
if(tail) {
ssize_t readLength = bs->readData(BUF, tail, offset);
if((size_t)readLength != tail) {
- throw DL_ABORT_EX
- (StringFormat(EX_FILE_READ, "n/a", "data is too short").str());
+ throw DL_ABORT_EX(fmt(EX_FILE_READ, "n/a", "data is too short"));
}
ctx->update(BUF, readLength);
}
@@ -103,11 +101,10 @@ void MessageDigestHelper::digest
size_t reqLength = ctx->getDigestLength();
if(mdLength < reqLength) {
throw DL_ABORT_EX
- (StringFormat
- ("Insufficient space for storing message digest:"
- " %lu required, but only %lu is allocated",
- static_cast<unsigned long>(reqLength),
- static_cast<unsigned long>(mdLength)).str());
+ (fmt("Insufficient space for storing message digest:"
+ " %lu required, but only %lu is allocated",
+ static_cast<unsigned long>(reqLength),
+ static_cast<unsigned long>(mdLength)));
}
ctx->update(data, length);
ctx->digest(md);