ProgressIndicator.h
Go to the documentation of this file.
1 // (C) Copyright Renaud Detry 2007-2015.
2 // Distributed under the GNU General Public License and under the
3 // BSD 3-Clause License (See accompanying file LICENSE.txt).
4 
5 /** @file */
6 
7 #ifndef NUKLEI_PROGRESSINDICATOR_H
8 #define NUKLEI_PROGRESSINDICATOR_H
9 
10 #include <string>
11 
12 namespace nuklei {
13 
14 
16  {
17  public:
18 
19  static const int spanStartDef, spanEndDef;
20  static const std::string messageDef;
21  static const std::string backspaceSequence;
22 
23 
25  ProgressIndicator(const int spanEnd,
26  const std::string &message = messageDef,
27  const unsigned minLogLevel = 0);
28  ProgressIndicator(const int spanStart,
29  const int spanEnd,
30  const std::string &message = messageDef,
31  const unsigned minLogLevel = 0);
32  virtual ~ProgressIndicator();
33 
34  void initialize(const int spanStart,
35  const int spanEnd,
36  const std::string &message,
37  const unsigned minLogLevel);
38 
39  void setMinLogLevel(const unsigned l);
40  unsigned getMinLogLevel() const;
41 
42  void setValue(const int value);
43  void setBackspace(const bool backspace);
44  void inc(const int value = 1);
45  void mtInc(const int value = 1);
46  const std::string& getMessage() const;
47  void setMessage(const std::string& message);
48  void rewind();
49  void forceEnd();
50  static int main(int argc, char ** argv);
51  private:
52  bool verbose_, backspace_;
53  unsigned minLogLevel_;
54  enum { ready, running, finished } state_;
55  int spanStart_, spanEnd_, spanLength_, spanPos_, current_, scale_;
56  std::string message_, colorStart_, colorEnd_;
57  /*static const int spanStartDef, spanEndDef;
58  static const char messageDef[];
59  static const char backspaceSequence[];*/
60  };
61 
62 
63 }
64 
65 #endif
66 
Public namespace.
Definition: Color.cpp:9
void inc(const int value=1)
void setValue(const int value)
void forceEnd()
ProgressIndicator()
Constructs a PI to go from spanStartDef to spanEndDef.
void mtInc(const int value=1)
void rewind()
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:06.