From b618ada28a49ed0e493647a6ea149bcd993129c1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 14 Dec 2008 03:59:24 +0000 Subject: 2008-12-14 Tatsuhiro Tsujikawa Added missing #ifdef guard. Added uc() function for String and removeKey() for Dict. * src/bencode.cc * src/bencode.h * test/BencodeTest.cc --- src/bencode.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/bencode.h') diff --git a/src/bencode.h b/src/bencode.h index 2a7fcea3..6c98836e 100644 --- a/src/bencode.h +++ b/src/bencode.h @@ -32,6 +32,9 @@ * files in the program, then also delete it here. */ /* copyright --> */ +#ifndef _D_BENCODE_H_ +#define _D_BENCODE_H_ + #include "common.h" #include @@ -110,6 +113,10 @@ public: // Returns std::string. Requires this object to be String const std::string& s() const throw(RecoverableException); + // Returns std::string.data() casted to unsigned char*. + // Use s().size() to get length. + const unsigned char* uc() const throw(RecoverableException); + ////////////////////////////////////////////////////////////////////////////// // Dictionary Interface @@ -133,6 +140,10 @@ public: // Requires this object to be Dict. bool containsKey(const std::string& key) const throw(RecoverableException); + // Removes specified key from dict. + // Requires this object to be Dict. + void removeKey(const std::string& key) const throw(RecoverableException); + // Returns a read/write iterator that points to the first pair in the dict. // Requires this object to be Dict. Dict::iterator dictBegin() throw(RecoverableException); @@ -212,3 +223,5 @@ std::string encode(const BDE& bde) throw(); } // namespace bencode } // namespace aria2 + +#endif // _D_BENCODE_H_ -- cgit