diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-11 21:09:51 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-11 21:09:51 +0900 |
| commit | 7c06b903f3493db95fcf4bd42cccc59e3b4d0692 (patch) | |
| tree | f10a85795bb086e0b257a0e6c6c5ffb05f28f344 /src/bencode2.h | |
| parent | 7a57ecc5f814dc305e5e4b9bd960d69b43870c0e (diff) | |
Use std::unique_ptr for ValueBase object hierarchy
Diffstat (limited to 'src/bencode2.h')
| -rw-r--r-- | src/bencode2.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/bencode2.h b/src/bencode2.h index e3896a3e..96e33b24 100644 --- a/src/bencode2.h +++ b/src/bencode2.h @@ -46,21 +46,19 @@ namespace aria2 { namespace bencode2 { // Decode the data whose length is len. -std::shared_ptr<ValueBase> decode(const unsigned char* data, size_t len); +std::unique_ptr<ValueBase> decode(const unsigned char* data, size_t len); -std::shared_ptr<ValueBase> decode(const std::string& data); +std::unique_ptr<ValueBase> 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::shared_ptr<ValueBase> decode(const unsigned char* data, size_t len, - size_t& end); +std::unique_ptr<ValueBase> decode(const unsigned char* data, size_t len, + size_t& end); -std::shared_ptr<ValueBase> decodeFromFile(const std::string& filename); +std::unique_ptr<ValueBase> decodeFromFile(const std::string& filename); std::string encode(const ValueBase* vlb); -std::string encode(const std::shared_ptr<ValueBase>& vlb); - } // namespace bencode2 } // namespace aria2 |
