diff --git a/bindgen-tests/tests/expectations/tests/blocklist-methods.rs b/bindgen-tests/tests/expectations/tests/blocklist-methods.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bindgen-tests/tests/headers/blocklist-methods.hpp b/bindgen-tests/tests/headers/blocklist-methods.hpp new file mode 100644 index 0000000000..4be21b945e --- /dev/null +++ b/bindgen-tests/tests/headers/blocklist-methods.hpp @@ -0,0 +1,8 @@ +// bindgen-flags: --blocklist-function="Foo_ba.*" + +class Foo { + public: + int foo(); + int bar(); + int baz(); +}; diff --git a/bindgen/lib.rs b/bindgen/lib.rs index 3696c499c5..03de8430d8 100644 --- a/bindgen/lib.rs +++ b/bindgen/lib.rs @@ -850,6 +850,10 @@ impl Builder { /// Hide the given function from the generated bindings. Regular expressions /// are supported. /// + /// Methods can be blocklisted by prefixing the name of the type implementing + /// them followed by an underscore. So if `Foo` has a method `bar`, it can + /// be blocklisted as `Foo_bar`. + /// /// To blocklist functions prefixed with "mylib" use `"mylib_.*"`. /// For more complicated expressions check /// [regex](https://docs.rs/regex/*/regex/) docs @@ -929,6 +933,10 @@ impl Builder { /// transitively refers to) appears in the generated bindings. Regular /// expressions are supported. /// + /// Methods can be allowlisted by prefixing the name of the type + /// implementing them followed by an underscore. So if `Foo` has a method + /// `bar`, it can be allowlisted as `Foo_bar`. + /// /// To allowlist functions prefixed with "mylib" use `"mylib_.*"`. /// For more complicated expressions check /// [regex](https://docs.rs/regex/*/regex/) docs