mirror of https://github.com/aria2/aria2
Removed MetalinkResource static strings
parent
be77d1394e
commit
8788cae7e3
|
@ -192,15 +192,14 @@ void MetalinkParserController::setTypeOfResource(const std::string& type)
|
||||||
if(!tResource_) {
|
if(!tResource_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(type == MetalinkResource::FTP) {
|
if(type == "ftp") {
|
||||||
tResource_->type = MetalinkResource::TYPE_FTP;
|
tResource_->type = MetalinkResource::TYPE_FTP;
|
||||||
} else if(type == MetalinkResource::HTTP) {
|
} else if(type == "http") {
|
||||||
tResource_->type = MetalinkResource::TYPE_HTTP;
|
tResource_->type = MetalinkResource::TYPE_HTTP;
|
||||||
} else if(type == MetalinkResource::HTTPS) {
|
} else if(type == "https") {
|
||||||
tResource_->type = MetalinkResource::TYPE_HTTPS;
|
tResource_->type = MetalinkResource::TYPE_HTTPS;
|
||||||
} else if(type == MetalinkResource::BITTORRENT) {
|
} else if(type == "bittorrent" || type == "torrent") {
|
||||||
tResource_->type = MetalinkResource::TYPE_BITTORRENT;
|
// "torrent" is Metalink4Spec
|
||||||
} else if(type == MetalinkResource::TORRENT) { // Metalink4Spec
|
|
||||||
tResource_->type = MetalinkResource::TYPE_BITTORRENT;
|
tResource_->type = MetalinkResource::TYPE_BITTORRENT;
|
||||||
} else {
|
} else {
|
||||||
tResource_->type = MetalinkResource::TYPE_NOT_SUPPORTED;
|
tResource_->type = MetalinkResource::TYPE_NOT_SUPPORTED;
|
||||||
|
|
|
@ -40,16 +40,6 @@ std::string MetalinkResource::type2String[] = {
|
||||||
"ftp", "http", "https", "bittorrent", "not_supported", "unknown"
|
"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()
|
MetalinkResource::MetalinkResource()
|
||||||
: type(TYPE_UNKNOWN),
|
: type(TYPE_UNKNOWN),
|
||||||
priority(getLowestPriority()),
|
priority(getLowestPriority()),
|
||||||
|
|
|
@ -52,17 +52,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string type2String[];
|
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:
|
public:
|
||||||
std::string url;
|
std::string url;
|
||||||
TYPE type;
|
TYPE type;
|
||||||
|
|
Loading…
Reference in New Issue