summaryrefslogtreecommitdiff
path: root/src/bencode2.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/bencode2.cc
parent580098eb4929a3bdbf424af18da361259ef2efe5 (diff)
2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced StringFormat with fmt
Diffstat (limited to 'src/bencode2.cc')
-rw-r--r--src/bencode2.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bencode2.cc b/src/bencode2.cc
index 1075fc92..29bf20da 100644
--- a/src/bencode2.cc
+++ b/src/bencode2.cc
@@ -37,7 +37,7 @@
#include <fstream>
#include <sstream>
-#include "StringFormat.h"
+#include "fmt.h"
#include "DlAbortEx.h"
namespace aria2 {
@@ -54,8 +54,8 @@ void checkdelim(std::istream& ss, const char delim = ':')
char d;
if(!(ss.get(d) && d == delim)) {
throw DL_ABORT_EX
- (StringFormat("Bencode decoding failed: Delimiter '%c' not found.",
- delim).str());
+ (fmt("Bencode decoding failed: Delimiter '%c' not found.",
+ delim));
}
}
} // namespace
@@ -77,10 +77,10 @@ std::string decoderawstring(std::istream& ss)
delete [] buf;
if(ss.gcount() != static_cast<int>(length)) {
throw DL_ABORT_EX
- (StringFormat("Bencode decoding failed:"
- " Expected %lu bytes of data, but only %ld read.",
- static_cast<unsigned long>(length),
- static_cast<long int>(ss.gcount())).str());
+ (fmt("Bencode decoding failed:"
+ " Expected %lu bytes of data, but only %ld read.",
+ static_cast<unsigned long>(length),
+ static_cast<long int>(ss.gcount())));
}
return str;
}
@@ -216,8 +216,8 @@ SharedHandle<ValueBase> decodeFromFile(const std::string& filename)
return decode(f);
} else {
throw DL_ABORT_EX
- (StringFormat("Bencode decoding failed:"
- " Cannot open file '%s'.", filename.c_str()).str());
+ (fmt("Bencode decoding failed: Cannot open file '%s'.",
+ filename.c_str()));
}
}