diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-13 14:15:23 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-13 14:15:23 +0000 |
| commit | 386d19693bc3b06bea14f8fa606f513b6fe1ac9d (patch) | |
| tree | 0137a837f6ce609ac1319b859a5333e0753f7527 /src/MetalinkParserController.cc | |
| parent | 9d03f0d2f747c7c66a64081a7cabcf4e02c11020 (diff) | |
2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Replaced "" with static const variable A2STR::NIL.
Replaced string comparison against "" with std::string::empty().
Added PROTO_* to Request class and use them as a protocol string
constant.
Made "started", "stopped", "completed" static const variable in
AnnounceList class.
Diffstat (limited to 'src/MetalinkParserController.cc')
| -rw-r--r-- | src/MetalinkParserController.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/MetalinkParserController.cc b/src/MetalinkParserController.cc index 85da8760..d6286506 100644 --- a/src/MetalinkParserController.cc +++ b/src/MetalinkParserController.cc @@ -38,6 +38,7 @@ #include "MetalinkResource.h" #include "FileEntry.h" #include "a2functional.h" +#include "A2STR.h" #ifdef ENABLE_MESSAGE_DIGEST # include "Checksum.h" # include "ChunkChecksum.h" @@ -86,7 +87,7 @@ void MetalinkParserController::setFileLengthOfEntry(uint64_t length) return; } if(_tEntry->file.isNull()) { - _tEntry->file.reset(new FileEntry("", length, 0)); + _tEntry->file.reset(new FileEntry(A2STR::NIL, length, 0)); } else { _tEntry->file->setLength(length); } @@ -165,13 +166,13 @@ void MetalinkParserController::setTypeOfResource(const std::string& type) if(_tResource.isNull()) { return; } - if(type == "ftp") { + if(type == MetalinkResource::FTP) { _tResource->type = MetalinkResource::TYPE_FTP; - } else if(type == "http") { + } else if(type == MetalinkResource::HTTP) { _tResource->type = MetalinkResource::TYPE_HTTP; - } else if(type == "https") { + } else if(type == MetalinkResource::HTTPS) { _tResource->type = MetalinkResource::TYPE_HTTPS; - } else if(type == "bittorrent") { + } else if(type == MetalinkResource::BITTORRENT) { _tResource->type = MetalinkResource::TYPE_BITTORRENT; } else { _tResource->type = MetalinkResource::TYPE_NOT_SUPPORTED; |
