|
@@ -32,6 +32,9 @@
|
|
* files in the program, then also delete it here.
|
|
* files in the program, then also delete it here.
|
|
*/
|
|
*/
|
|
/* copyright --> */
|
|
/* copyright --> */
|
|
|
|
+#ifndef _D_BENCODE_H_
|
|
|
|
+#define _D_BENCODE_H_
|
|
|
|
+
|
|
#include "common.h"
|
|
#include "common.h"
|
|
|
|
|
|
#include <string>
|
|
#include <string>
|
|
@@ -110,6 +113,10 @@ public:
|
|
// Returns std::string. Requires this object to be String
|
|
// Returns std::string. Requires this object to be String
|
|
const std::string& s() const throw(RecoverableException);
|
|
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
|
|
// Dictionary Interface
|
|
|
|
|
|
@@ -133,6 +140,10 @@ public:
|
|
// Requires this object to be Dict.
|
|
// Requires this object to be Dict.
|
|
bool containsKey(const std::string& key) const throw(RecoverableException);
|
|
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.
|
|
// Returns a read/write iterator that points to the first pair in the dict.
|
|
// Requires this object to be Dict.
|
|
// Requires this object to be Dict.
|
|
Dict::iterator dictBegin() throw(RecoverableException);
|
|
Dict::iterator dictBegin() throw(RecoverableException);
|
|
@@ -212,3 +223,5 @@ std::string encode(const BDE& bde) throw();
|
|
} // namespace bencode
|
|
} // namespace bencode
|
|
|
|
|
|
} // namespace aria2
|
|
} // namespace aria2
|
|
|
|
+
|
|
|
|
+#endif // _D_BENCODE_H_
|