/* */ #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, TYPE_UNKNOWN }; 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; std::string location; int priority; int maxConnections; // Metalink3Spec public: MetalinkResource(); ~MetalinkResource(); MetalinkResource& operator=(const MetalinkResource& metalinkResource) { if(this != &metalinkResource) { this->url = metalinkResource.url; this->type = metalinkResource.type; this->location = metalinkResource.location; this->priority = metalinkResource.priority; this->maxConnections = metalinkResource.maxConnections; } return *this; } static const std::string& getTypeString(TYPE type) { return type2String[type]; } static int getLowestPriority() { return 999999; } }; } // namespace aria2 #endif // _D_METALINK_RESOURCE_H_