/* */ #ifndef _D_METALINK_RESOURCE_H_ #define _D_METALINK_RESOURCE_H_ #include "common.h" #include namespace aria2 { class MetalinkResource { public: enum TYPE { TYPE_FTP = 0, TYPE_HTTP, TYPE_HTTPS, TYPE_BITTORRENT, TYPE_NOT_SUPPORTED }; static std::string type2String[]; public: std::string url; TYPE type; std::string location; int preference; int maxConnections; public: MetalinkResource(); ~MetalinkResource(); MetalinkResource& operator=(const MetalinkResource& metalinkResource) { if(this != &metalinkResource) { this->url = metalinkResource.url; this->type = metalinkResource.type; this->location = metalinkResource.location; this->preference = metalinkResource.preference; this->maxConnections = metalinkResource.maxConnections; } return *this; } static const std::string& getTypeString(TYPE type) { return type2String[type]; } }; } // namespace aria2 #endif // _D_METALINK_RESOURCE_H_