diff options
| author | Glenn Smith <glenn@vector35.com> | 2024-06-30 18:14:39 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2024-07-18 16:18:01 -0400 |
| commit | 3488068810307387117626066240761195266659 (patch) | |
| tree | 8307a7cd9b5ced9f249f8a349fa3dbb38aa2252c /binaryninjaapi.cpp | |
| parent | 6a496b01b3e8a85c8231c949a306933e7ad58bfc (diff) | |
Add fuzzy completion to the python console
Co-Authored-By: Rusty Wagner <rusty@vector35.com>
Co-Authored-By: Kyle Miles <kyle@vector35.com>
Diffstat (limited to 'binaryninjaapi.cpp')
| -rw-r--r-- | binaryninjaapi.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/binaryninjaapi.cpp b/binaryninjaapi.cpp index 6610782d..202019ed 100644 --- a/binaryninjaapi.cpp +++ b/binaryninjaapi.cpp @@ -585,3 +585,14 @@ fmt::format_context::iterator fmt::formatter<BinaryNinja::NameList>::format(cons { return fmt::format_to(ctx.out(), "{}", obj.GetString()); } + + +std::optional<size_t> BinaryNinja::FuzzyMatchSingle(const std::string& target, const std::string& query) +{ + size_t result = BNFuzzyMatchSingle(target.c_str(), query.c_str()); + if (result == 0) + { + return std::nullopt; + } + return result; +} |
