libzypp 17.37.17
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
19namespace 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:
71};
72
74inline 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)
char current() const
Definition AliveCursor.h:29
AliveCursor & done()
Definition AliveCursor.h:63
AliveCursor & operator++(int)
Definition AliveCursor.h:57
AliveCursor & operator++()
Definition AliveCursor.h:51
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)