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
5 changed files
with
348 additions
and
2 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
|
@@ -884,6 +884,18 @@ namespace libtorrent { | |
}; | ||
|
||
%extend entry { | ||
entry& get(std::string const& key) { | ||
return $self->operator[](key); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aldenml
Author
Collaborator
|
||
} | ||
|
||
void set(std::string const& key, std::string const& value) { | ||
$self->operator[](key) = value; | ||
} | ||
|
||
void set(std::string const& key, long const& value) { | ||
$self->operator[](key) = value; | ||
} | ||
|
||
std::vector<int8_t> bencode() { | ||
std::vector<int8_t> buffer; | ||
libtorrent::bencode(std::back_inserter(buffer), *$self); | ||
|
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.
brainfuck
I suppose this doesn't work:
return $self[key]
but this should be the equivalent.how come it returns a
entry&
and not aentry*
? first time I see a function returningtype&