diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 15:53:45 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 15:53:45 +0000 |
| commit | 1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch) | |
| tree | d12047cb37ded1e18d4d5b97844412538beb19ff /src/BencodeVisitor.cc | |
| parent | d82e183d346375ac8a58a298a58728be615f947e (diff) | |
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std::
prefix to c++
standard classes.
Included string.h where mem* function are used.
Diffstat (limited to 'src/BencodeVisitor.cc')
| -rw-r--r-- | src/BencodeVisitor.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/BencodeVisitor.cc b/src/BencodeVisitor.cc index b21585ee..f8fc0446 100644 --- a/src/BencodeVisitor.cc +++ b/src/BencodeVisitor.cc @@ -37,6 +37,10 @@ #include "List.h" #include "Dictionary.h" #include "Util.h" +#include <functional> +#include <algorithm> + +namespace aria2 { BencodeVisitor::BencodeVisitor() {} @@ -54,8 +58,8 @@ void BencodeVisitor::visit(const Data* d) void BencodeVisitor::visit(const List* l) { _bencodedData += "l"; - for_each(l->getList().begin(), l->getList().end(), - bind2nd(mem_fun(&MetaEntry::accept), this)); + std::for_each(l->getList().begin(), l->getList().end(), + std::bind2nd(std::mem_fun(&MetaEntry::accept), this)); _bencodedData += "e"; } @@ -63,7 +67,7 @@ void BencodeVisitor::visit(const Dictionary* d) { _bencodedData += "d"; - for(Order::const_iterator itr = d->getOrder().begin(); itr != d->getOrder().end(); ++itr) { + for(std::deque<std::string>::const_iterator itr = d->getOrder().begin(); itr != d->getOrder().end(); ++itr) { _bencodedData += Util::itos((int32_t)(*itr).size()); _bencodedData += ":"; _bencodedData += *itr; @@ -82,3 +86,5 @@ void BencodeVisitor::visit(const MetaEntry* e) visit(reinterpret_cast<const Dictionary*>(e)); } } + +} // namespace aria2 |
