summaryrefslogtreecommitdiffstats
path: root/grep-searcher/src/line_buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'grep-searcher/src/line_buffer.rs')
-rw-r--r--grep-searcher/src/line_buffer.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/grep-searcher/src/line_buffer.rs b/grep-searcher/src/line_buffer.rs
index c2e54a9e..cc7dd578 100644
--- a/grep-searcher/src/line_buffer.rs
+++ b/grep-searcher/src/line_buffer.rs
@@ -317,6 +317,14 @@ pub struct LineBuffer {
}
impl LineBuffer {
+ /// Set the binary detection method used on this line buffer.
+ ///
+ /// This permits dynamically changing the binary detection strategy on
+ /// an existing line buffer without needing to create a new one.
+ pub fn set_binary_detection(&mut self, binary: BinaryDetection) {
+ self.config.binary = binary;
+ }
+
/// Reset this buffer, such that it can be used with a new reader.
fn clear(&mut self) {
self.pos = 0;