/* */ #ifndef D_PROTOCOL_DETECTOR_H #define D_PROTOCOL_DETECTOR_H #include "common.h" #include namespace aria2 { class ProtocolDetector { public: ProtocolDetector(); ~ProtocolDetector(); // Returns true if uri is http(s)/ftp, otherwise returns false. bool isStreamProtocol(const std::string& uri) const; // Returns true if ProtocolDetector thinks uri is a path of BitTorrent // metainfo file, otherwise returns false. bool guessTorrentFile(const std::string& uri) const; // Returns true if ProtocolDetector thinks uri is BitTorrent Magnet link. // magnet:?xt=urn:btih:... bool guessTorrentMagnet(const std::string& uri) const; // Returns true if ProtocolDetector thinks uri is a path of Metalink XML // file, otherwise return false. bool guessMetalinkFile(const std::string& uri) const; }; } // namespace aria2 #endif // D_PROTOCOL_DETECTOR_H