summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2025-03-05 11:36:34 -0500
committerBrian Potchik <brian@vector35.com>2025-03-05 11:36:34 -0500
commit55577a41417ce72f82d46dd04cc90729ecc12391 (patch)
tree84991af908fc219aae742ff77eff1c3f667bdbb2 /binaryview.cpp
parent9f1c62e99e6dc797ee81716f7d3eb6b722b5270d (diff)
Improvements for advanced binary search.
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index a6546951..981e8329 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -4795,11 +4795,13 @@ bool BinaryView::FindAllConstant(uint64_t start, uint64_t end, uint64_t constant
}
-bool BinaryView::Search(const string& query, const std::function<bool(uint64_t offset, const DataBuffer& buffer)>& otherCallback)
+bool BinaryView::Search(const string& query, const std::function<bool(size_t current, size_t total)>& progressCallback, const std::function<bool(uint64_t offset, const DataBuffer& buffer)>& matchCallback)
{
+ ProgressContext fp;
+ fp.callback = progressCallback;
MatchCallbackContextForDataBuffer mc;
- mc.func = otherCallback;
- return BNSearch(m_object, query.c_str(), &mc, MatchCallbackForDataBuffer);
+ mc.func = matchCallback;
+ return BNSearch(m_object, query.c_str(), &fp, ProgressCallback, &mc, MatchCallbackForDataBuffer);
}