libzypp  17.35.16
AliveCursor.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 ----------------------------------------------------------------------/
9 *
10 * This file contains private API, this might break at any time between releases.
11 * Strictly for internal use!
12 */
13 
14 #ifndef ZYPP_TUI_OUTPUT_ALIVE_CURSOR_H
15 #define ZYPP_TUI_OUTPUT_ALIVE_CURSOR_H
16 
17 #include <iostream>
18 
19 namespace ztui {
20 
22 {
23  public:
24  friend std::ostream & operator<<( std::ostream & str, const AliveCursor & obj );
25 
27  {}
28 
29  char current() const
30  { return _current; }
31 
32  void increase()
33  {
34  switch ( _current )
35  {
36  case '-':
37  _current = '\\';
38  break;
39  case '\\':
40  _current = '|';
41  break;
42  case '|':
43  _current = '/';
44  break;
45  case '/':
46  _current = '-';
47  break;
48  }
49  }
50 
52  {
53  increase();
54  return *this;
55  }
56 
58  {
59  increase();
60  return *this;
61  }
62 
64  {
65  _current = '*';
66  return *this;
67  }
68 
69  private:
70  char _current;
71 };
72 
74 inline std::ostream & operator<<( std::ostream & str, const AliveCursor & obj )
75 { return str << obj.current(); }
76 
77 }
78 
79 #endif
80 
friend std::ostream & operator<<(std::ostream &str, const AliveCursor &obj)
AliveCursor & done()
Definition: AliveCursor.h:63
char current() const
Definition: AliveCursor.h:29
String related utilities and Regular expression matching.
AliveCursor & operator++(int)
Definition: AliveCursor.h:57
TableRow && operator<<(TableRow &&tr, Tp_ &&val)
Definition: Table.h:257
AliveCursor & operator++()
Definition: AliveCursor.h:51