Use a span interface

This commit is contained in:
Romain Thomas
2022-02-13 10:39:38 +01:00
parent ef585e2b35
commit 50986fcaf1
66 changed files with 2460 additions and 1763 deletions
+4 -1
View File
@@ -64,7 +64,10 @@ void create<Section>(py::module& m) {
"Section's virtual address")
.def_property("content",
static_cast<getter_t<std::vector<uint8_t>>>(&Section::content),
[] (const Section& self) {
span<const uint8_t> content = self.content();
return py::memoryview::from_memory(content.data(), content.size());
},
static_cast<setter_t<const std::vector<uint8_t>&>>(&Section::content),
"Section's content")