/* */ #ifndef _D_BENCODE_H_ #define _D_BENCODE_H_ #include "common.h" #include #include #include "BDE.h" namespace aria2 { namespace bencode { const size_t MAX_STRUCTURE_DEPTH = 100; BDE decode(std::istream& in); // Decode the data in s. BDE decode(const std::string& s); // Decode the data in s. After decode is done successfully, return the // bencoded string length in end. BDE decode(const std::string& s, size_t& end); BDE decode(const unsigned char* data, size_t length); BDE decode(const unsigned char* data, size_t length, size_t& end); BDE decodeFromFile(const std::string& filename); std::string encode(const BDE& bde); } // namespace bencode } // namespace aria2 #endif // _D_BENCODE_H_