Added iomanip to clear term line
This commit is contained in:
		@@ -66,3 +66,12 @@ cursor_hider::cursor_hider(std::ostream* out) : _out {out} {
 | 
			
		||||
cursor_hider::~cursor_hider() {
 | 
			
		||||
    *_out << io::show_cursor;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
sc::io::clear_line::clear_line(const term& t) : _term {t} {}
 | 
			
		||||
 | 
			
		||||
std::ostream& sc::io::operator<<(std::ostream& out, const sc::io::clear_line& obj) {
 | 
			
		||||
    out << '\r' << std::string(obj._term.cols(), ' ') << '\r';
 | 
			
		||||
    return out;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -33,6 +33,17 @@ namespace sc {
 | 
			
		||||
            ~cursor_hider();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    namespace io {
 | 
			
		||||
 | 
			
		||||
        class clear_line {
 | 
			
		||||
            const term& _term;
 | 
			
		||||
 | 
			
		||||
            public:
 | 
			
		||||
                clear_line(const term& t);
 | 
			
		||||
                friend std::ostream& operator<<(std::ostream& out, const clear_line& obj);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif // UTILS_H_
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user