/* */ #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. std::unique_ptr decode(const unsigned char* data, size_t len); std::unique_ptr decode(const std::string& data); // Decode the data whose length is len. After decode is done // successfully, return the bencoded string length in end. std::unique_ptr decode(const unsigned char* data, size_t len, size_t& end); std::unique_ptr decodeFromFile(const std::string& filename); std::string encode(const ValueBase* vlb); } // namespace bencode2 } // namespace aria2 #endif // D_BENCODE2_H