* Moved hash and torrent size checking to initialize so it will be

caught when loading a torrent.

* Added VariableMap to core::Download and started moving various
settings.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@624 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-01-19 17:13:25 +00:00
parent e8cd37ea3a
commit 52636178d1
14 changed files with 242 additions and 114 deletions
+30
View File
@@ -61,6 +61,36 @@ private:
torrent::Bencode m_variable;
};
class VariableBool : public Variable {
public:
VariableBool(bool state) : m_variable(state ? (int64_t)1 : (int64_t)0) {}
VariableBool(const torrent::Bencode& v = torrent::Bencode((int64_t)0)) { set(v); }
virtual ~VariableBool();
virtual const torrent::Bencode& get();
virtual void set(const torrent::Bencode& arg);
private:
torrent::Bencode m_variable;
};
class VariableBencode : public Variable {
public:
typedef torrent::Bencode::Type Type;
VariableBencode(torrent::Bencode* b, const std::string& key, Type t = torrent::Bencode::TYPE_NONE) :
m_bencode(b), m_key(key), m_type(t) {}
virtual ~VariableBencode();
virtual const torrent::Bencode& get();
virtual void set(const torrent::Bencode& arg);
private:
torrent::Bencode* m_bencode;
std::string m_key;
Type m_type;
};
template <typename Get = std::string, typename Set = const std::string&>
class VariableSlotString : public Variable {
public: