mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
This commit cleans and modernizes the code base of LIEF.
Among the changes: - It removes the ``and, or, not`` keywords - It updates the Documentation - It moves the internal structures in the ``details::`` namespace
This commit is contained in:
@@ -32,7 +32,10 @@ using setter_t = void (Function::*)(T);
|
||||
template<>
|
||||
void create<Function>(py::module& m) {
|
||||
|
||||
py::class_<Function, Symbol> pyfunction(m, "Function");
|
||||
py::class_<Function, Symbol> pyfunction(m, "Function",
|
||||
R"delim(
|
||||
Class which represents a Function in an executable file format.
|
||||
)delim");
|
||||
|
||||
py::enum_<Function::FLAGS>(pyfunction, "FLAGS")
|
||||
.value(PY_ENUM(Function::FLAGS::IMPORTED))
|
||||
@@ -47,16 +50,22 @@ void create<Function>(py::module& m) {
|
||||
.def(py::init<uint64_t>())
|
||||
.def(py::init<const std::string&, uint64_t>())
|
||||
|
||||
.def("add",
|
||||
&Function::add,
|
||||
"Add the given " RST_CLASS_REF(lief.Function.FLAGS) "",
|
||||
"flag"_a)
|
||||
|
||||
.def_property_readonly("flags",
|
||||
&Function::flags,
|
||||
"Function flags as a list of " RST_CLASS_REF(lief.Function.FLAGS) "")
|
||||
|
||||
.def_property("address",
|
||||
static_cast<getter_t<uint64_t>>(&Function::address),
|
||||
static_cast<setter_t<uint64_t>>(&Function::address),
|
||||
"Function's address")
|
||||
|
||||
|
||||
.def("__str__",
|
||||
[] (const Function& f)
|
||||
{
|
||||
[] (const Function& f) {
|
||||
std::ostringstream stream;
|
||||
stream << f;
|
||||
std::string str = stream.str();
|
||||
|
||||
Reference in New Issue
Block a user