Public Member Functions | |
ProgressIndicator () | |
Constructs a PI to go from spanStartDef to spanEndDef. | |
ProgressIndicator (const int spanEnd, const std::string &message=messageDef, const unsigned minLogLevel=0) | |
Constructs a PI which will scale [spanStartDef spanEnd] to [0 100]. | |
ProgressIndicator (const int spanStart, const int spanEnd, const std::string &message=messageDef, const unsigned minLogLevel=0) | |
Constructs a PI which will scale [spanStart spanEnd] to [0 100]. | |
void | initialize (const int spanStart, const int spanEnd, const std::string &message, const unsigned minLogLevel) |
void | setMinLogLevel (const unsigned l) |
unsigned | getMinLogLevel () const |
void | setValue (const int value) |
void | setBackspace (const bool backspace) |
void | inc (const int value=1) |
void | mtInc (const int value=1) |
const std::string & | getMessage () const |
void | setMessage (const std::string &message) |
void | rewind () |
void | forceEnd () |
Static Public Member Functions | |
static int | main (int argc, char **argv) |
Static Public Attributes | |
static const int | spanStartDef = 0 |
static const int | spanEndDef = 100 |
static const std::string | messageDef = "Progress: " |
static const std::string | backspaceSequence = "\033[A" |
Definition at line 15 of file ProgressIndicator.h.
void nuklei::ProgressIndicator::forceEnd | ( | ) |
Forces the display of 100% and a new line.
Definition at line 227 of file ProgressIndicator.cpp.
References setValue().
void nuklei::ProgressIndicator::inc | ( | const int | value = 1 | ) |
Use inside the loop.
value | the progress value between spanStart and spanEnd. |
Definition at line 188 of file ProgressIndicator.cpp.
References setValue().
void nuklei::ProgressIndicator::mtInc | ( | const int | value = 1 | ) |
Use inside the loop.
value | the progress value between spanStart and spanEnd. |
Definition at line 198 of file ProgressIndicator.cpp.
References setValue().
void nuklei::ProgressIndicator::rewind | ( | ) |
Gets the PI ready to be used again. This is not a reset, since spanStart, spanEnd etc. are not reset.
Definition at line 219 of file ProgressIndicator.cpp.
void nuklei::ProgressIndicator::setValue | ( | const int | value | ) |
Use inside the loop.
value | the progress value between spanStart and spanEnd. |
Definition at line 131 of file ProgressIndicator.cpp.
Referenced by forceEnd(), inc(), and mtInc().