From 4f4c627b77a169e1729982fa03dd75d5035f0297 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 4 Aug 2018 19:50:21 -0400 Subject: ClosedFileInputSource: add method to keep file open During periods of intensive operation on a specific file, this method can reduce the overhead of repeated open/close operations. --- libtests/closed_file_input_source.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libtests/closed_file_input_source.cc') diff --git a/libtests/closed_file_input_source.cc b/libtests/closed_file_input_source.cc index 9cf5ff04..7309ca31 100644 --- a/libtests/closed_file_input_source.cc +++ b/libtests/closed_file_input_source.cc @@ -65,6 +65,11 @@ int main() std::cout << "testing with ClosedFileInputSource\n"; ClosedFileInputSource cf("input"); do_tests(&cf); + std::cout << "testing with ClosedFileInputSource in stay open mode\n"; + ClosedFileInputSource cf2("input"); + cf2.stayOpen(true); + do_tests(&cf2); + cf2.stayOpen(false); std::cout << "testing with FileInputSource\n"; FileInputSource f; f.setFilename("input"); -- cgit v1.2.3-54-g00ecf