-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pursuant to #30, this commit adds a '-progress' option. If set to true, then a function pointer is passed to 'fillwithbytes', with the result that each iteration of the loop in that function outputs a progress update. The progress update appears at the end of the current line and overwrites itself with each repetition, producing an output resembling the following: Now eliminating candidates based on [...]: (16/19324)
- Loading branch information
Showing
6 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "ListProgress.hh" | ||
|
||
#include <iostream> | ||
|
||
void | ||
outputMlistProgress(int completed, int total) | ||
{ | ||
std::cout << "\033[s\033[K" // Save the cursor position & clear following text | ||
<< "(" << completed << "/" << total << ")" << std::flush | ||
<< "\033[u"; // Restore the cursor to the saved position | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifndef list_progress_hh | ||
#define list_progress_hh | ||
|
||
void | ||
outputMlistProgress(int completed, int total); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters