/* */ #ifndef D_BENCODE2_H #define D_BENCODE2_H #include "common.h" #include #include "ValueBase.h" namespace aria2 { namespace bencode2 { // Decode the data whose length is len. SharedHandle decode(const unsigned char* data, size_t len); SharedHandle decode(const std::string& data); // Decode the data whose length is len. After decode is done // successfully, return the bencoded string length in end. SharedHandle decode(const unsigned char* data, size_t len, size_t& end); SharedHandle decodeFromFile(const std::string& filename); std::string encode(const ValueBase* vlb); std::string encode(const SharedHandle& vlb); } // namespace bencode2 } // namespace aria2 #endif // D_BENCODE2_H