Removed MetalinkResource static strings

pull/28/head
Tatsuhiro Tsujikawa 2012-09-25 23:03:19 +09:00
parent be77d1394e
commit 8788cae7e3
3 changed files with 5 additions and 27 deletions

View File

@ -192,15 +192,14 @@ void MetalinkParserController::setTypeOfResource(const std::string& type)
if(!tResource_) {
return;
}
if(type == MetalinkResource::FTP) {
if(type == "ftp") {
tResource_->type = MetalinkResource::TYPE_FTP;
} else if(type == MetalinkResource::HTTP) {
} else if(type == "http") {
tResource_->type = MetalinkResource::TYPE_HTTP;
} else if(type == MetalinkResource::HTTPS) {
} else if(type == "https") {
tResource_->type = MetalinkResource::TYPE_HTTPS;
} else if(type == MetalinkResource::BITTORRENT) {
tResource_->type = MetalinkResource::TYPE_BITTORRENT;
} else if(type == MetalinkResource::TORRENT) { // Metalink4Spec
} else if(type == "bittorrent" || type == "torrent") {
// "torrent" is Metalink4Spec
tResource_->type = MetalinkResource::TYPE_BITTORRENT;
} else {
tResource_->type = MetalinkResource::TYPE_NOT_SUPPORTED;

View File

@ -40,16 +40,6 @@ std::string MetalinkResource::type2String[] = {
"ftp", "http", "https", "bittorrent", "not_supported", "unknown"
};
const std::string MetalinkResource::HTTP("http");
const std::string MetalinkResource::HTTPS("https");
const std::string MetalinkResource::FTP("ftp");
const std::string MetalinkResource::BITTORRENT("bittorrent");
const std::string MetalinkResource::TORRENT("torrent");
MetalinkResource::MetalinkResource()
: type(TYPE_UNKNOWN),
priority(getLowestPriority()),

View File

@ -52,17 +52,6 @@ public:
};
static std::string type2String[];
static const std::string HTTP;
static const std::string HTTPS;
static const std::string FTP;
static const std::string BITTORRENT;
static const std::string TORRENT; // Metalink4Spec
public:
std::string url;
TYPE type;