Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
979 additions
and
725 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
include/Hadouken/Scripting/Modules/BitTorrent/PeerInfoWrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef HADOUKEN_SCRIPTING_MODULES_BITTORRENT_PEERINFOWRAPPER_HPP | ||
#define HADOUKEN_SCRIPTING_MODULES_BITTORRENT_PEERINFOWRAPPER_HPP | ||
|
||
#include <memory> | ||
|
||
namespace Hadouken | ||
{ | ||
namespace BitTorrent | ||
{ | ||
struct PeerInfo; | ||
} | ||
} | ||
|
||
namespace Hadouken | ||
{ | ||
namespace Scripting | ||
{ | ||
namespace Modules | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class PeerInfoWrapper | ||
{ | ||
public: | ||
static void initialize(void* ctx, Hadouken::BitTorrent::PeerInfo& peerInfo); | ||
|
||
static const char* field; | ||
|
||
private: | ||
static int finalize(void* ctx); | ||
|
||
static int getCountry(void* ctx); | ||
static int getIp(void* ctx); | ||
static int getPort(void* ctx); | ||
static int getConnectionType(void* ctx); | ||
static int getClient(void* ctx); | ||
static int getProgress(void* ctx); | ||
static int getDownloadRate(void* ctx); | ||
static int getUploadRate(void* ctx); | ||
static int getDownloadedBytes(void* ctx); | ||
static int getUploadedBytes(void* ctx); | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
42 changes: 42 additions & 0 deletions
42
include/Hadouken/Scripting/Modules/BitTorrent/SessionWrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#ifndef HADOUKEN_SCRIPTING_MODULES_BITTORRENT_SESSIONWRAPPER_HPP | ||
#define HADOUKEN_SCRIPTING_MODULES_BITTORRENT_SESSIONWRAPPER_HPP | ||
|
||
#include <memory> | ||
|
||
namespace Hadouken | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class Session; | ||
struct TorrentHandle; | ||
} | ||
} | ||
|
||
namespace Hadouken | ||
{ | ||
namespace Scripting | ||
{ | ||
namespace Modules | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class SessionWrapper | ||
{ | ||
public: | ||
static void initialize(void* ctx, Hadouken::BitTorrent::Session& session); | ||
|
||
static const char* field; | ||
|
||
private: | ||
static int addTorrentFile(void* ctx); | ||
static int addTorrentUri(void* ctx); | ||
static int findTorrent(void* ctx); | ||
static int getTorrents(void* ctx); | ||
static int removeTorrent(void* ctx); | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
47 changes: 47 additions & 0 deletions
47
include/Hadouken/Scripting/Modules/BitTorrent/TorrentHandleWrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef HADOUKEN_SCRIPTING_MODULES_BITTORRENT_TORRENTHANDLEWRAPPER_HPP | ||
#define HADOUKEN_SCRIPTING_MODULES_BITTORRENT_TORRENTHANDLEWRAPPER_HPP | ||
|
||
#include <memory> | ||
|
||
namespace Hadouken | ||
{ | ||
namespace BitTorrent | ||
{ | ||
struct TorrentHandle; | ||
} | ||
} | ||
|
||
namespace Hadouken | ||
{ | ||
namespace Scripting | ||
{ | ||
namespace Modules | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class TorrentHandleWrapper | ||
{ | ||
public: | ||
static void initialize(void* ctx, std::shared_ptr<Hadouken::BitTorrent::TorrentHandle> handle); | ||
|
||
static const char* field; | ||
|
||
private: | ||
static int finalize(void* ctx); | ||
|
||
static int getInfoHash(void* ctx); | ||
static int getPeers(void* ctx); | ||
static int getQueuePosition(void* ctx); | ||
static int getStatus(void* ctx); | ||
static int getTags(void* ctx); | ||
static int getTorrentInfo(void* ctx); | ||
static int moveStorage(void* ctx); | ||
static int pause(void* ctx); | ||
static int resume(void* ctx); | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
41 changes: 41 additions & 0 deletions
41
include/Hadouken/Scripting/Modules/BitTorrent/TorrentInfoWrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef HADOUKEN_SCRIPTING_MODULES_BITTORRENT_TORRENTINFOWRAPPER_HPP | ||
#define HADOUKEN_SCRIPTING_MODULES_BITTORRENT_TORRENTINFOWRAPPER_HPP | ||
|
||
#include <memory> | ||
|
||
namespace Hadouken | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class TorrentInfo; | ||
struct TorrentHandle; | ||
} | ||
} | ||
|
||
namespace Hadouken | ||
{ | ||
namespace Scripting | ||
{ | ||
namespace Modules | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class TorrentInfoWrapper | ||
{ | ||
public: | ||
static void initialize(void* ctx, Hadouken::BitTorrent::TorrentHandle& handle, std::unique_ptr<Hadouken::BitTorrent::TorrentInfo> torrentInfo); | ||
|
||
static const char* field; | ||
|
||
private: | ||
static int finalize(void* ctx); | ||
|
||
static int getFiles(void* ctx); | ||
static int getTotalSize(void* ctx); | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
55 changes: 55 additions & 0 deletions
55
include/Hadouken/Scripting/Modules/BitTorrent/TorrentStatusWrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef HADOUKEN_SCRIPTING_MODULES_BITTORRENT_TORRENTSTATUSWRAPPER_HPP | ||
#define HADOUKEN_SCRIPTING_MODULES_BITTORRENT_TORRENTSTATUSWRAPPER_HPP | ||
|
||
#include <memory> | ||
|
||
namespace Hadouken | ||
{ | ||
namespace BitTorrent | ||
{ | ||
struct TorrentStatus; | ||
} | ||
} | ||
|
||
namespace Hadouken | ||
{ | ||
namespace Scripting | ||
{ | ||
namespace Modules | ||
{ | ||
namespace BitTorrent | ||
{ | ||
class TorrentStatusWrapper | ||
{ | ||
public: | ||
static void initialize(void* ctx, Hadouken::BitTorrent::TorrentStatus& status); | ||
|
||
static const char* field; | ||
|
||
private: | ||
static int finalize(void* ctx); | ||
|
||
static int getName(void* ctx); | ||
static int getProgress(void* ctx); | ||
static int getSavePath(void* ctx); | ||
static int getDownloadRate(void* ctx); | ||
static int getUploadRate(void* ctx); | ||
static int getDownloadedBytes(void* ctx); | ||
static int getDownloadedBytesTotal(void* ctx); | ||
static int getUploadedBytes(void* ctx); | ||
static int getUploadedBytesTotal(void* ctx); | ||
static int getNumPeers(void* ctx); | ||
static int getNumSeeds(void* ctx); | ||
static int getState(void* ctx); | ||
static int isFinished(void* ctx); | ||
static int isMovingStorage(void* ctx); | ||
static int isPaused(void* ctx); | ||
static int isSeeding(void* ctx); | ||
static int isSequentialDownload(void* ctx); | ||
}; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.