bkcrack 1.7.1
Crack legacy zip encryption with Biham and Kocher's known plaintext attack.
ConsoleProgress.hpp
1#ifndef BKCRACK_CONSOLEPROGRESS_HPP
2#define BKCRACK_CONSOLEPROGRESS_HPP
3
4#include "Progress.hpp"
5
6#include <condition_variable>
7#include <mutex>
8#include <thread>
9
12{
13public:
15 explicit ConsoleProgress(std::ostream& os,
16 const std::chrono::milliseconds& interval = std::chrono::milliseconds{200});
17
20
21private:
22 const std::chrono::milliseconds m_interval;
23
24 std::mutex m_in_destructor_mutex;
25 std::condition_variable m_in_destructor_cv;
26 bool m_in_destructor;
27
28 std::thread m_printer;
29 void printerFunction();
30};
31
32#endif // BKCRACK_CONSOLEPROGRESS_HPP
ConsoleProgress(std::ostream &os, const std::chrono::milliseconds &interval=std::chrono::milliseconds{200})
Start a thread to print progress.
~ConsoleProgress()
Notify and stop the printing thread.
Progress(std::ostream &os)
Constructor.