2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Removed visit(const MetaEntry*)
	* src/MetaEntryVisitor.h:
	Added visit(const Data*),visit(const Dictionary*),visit(const 
List*)
	and made them virtual.
	* src/BencodeVisitor.h
	* src/BencodeVisitor.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-06-17 08:43:44 +00:00
parent b1c79f5ce5
commit f393751ec8
4 changed files with 21 additions and 17 deletions

View File

@ -1,3 +1,12 @@
2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed visit(const MetaEntry*)
* src/MetaEntryVisitor.h:
Added visit(const Data*),visit(const Dictionary*),visit(const List*)
and made them virtual.
* src/BencodeVisitor.h
* src/BencodeVisitor.cc
2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated po files.

View File

@ -76,15 +76,4 @@ void BencodeVisitor::visit(const Dictionary* d)
_bencodedData += "e";
}
void BencodeVisitor::visit(const MetaEntry* e)
{
if(dynamic_cast<const Data*>(e) != 0) {
visit(reinterpret_cast<const Data*>(e));
} else if(dynamic_cast<const List*>(e) != 0) {
visit(reinterpret_cast<const List*>(e));
} else if(dynamic_cast<const Dictionary*>(e) != 0) {
visit(reinterpret_cast<const Dictionary*>(e));
}
}
} // namespace aria2

View File

@ -52,11 +52,11 @@ public:
BencodeVisitor();
~BencodeVisitor();
void visit(const Data* d);
void visit(const Dictionary* d);
void visit(const List* l);
virtual void visit(const Data* d);
virtual void visit(const MetaEntry* e);
virtual void visit(const Dictionary* d);
virtual void visit(const List* l);
const std::string& getBencodedData() const
{

View File

@ -39,13 +39,19 @@
namespace aria2 {
class MetaEntry;
class Data;
class Dictionary;
class List;
class MetaEntryVisitor {
public:
virtual ~MetaEntryVisitor() {}
virtual void visit(const MetaEntry* e) = 0;
virtual void visit(const Data* d) = 0;
virtual void visit(const Dictionary* d) = 0;
virtual void visit(const List* l) = 0;
};
} // namespace aria2