115 cerr << hint << endl;
122 static const bool dbg =
getenv(
"ZYPPER_PBD");
123 return (dbg ?
str << std::endl :
str << std::flush );
152 cout <<
'.' << std::flush;
177 cout <<
'.' << std::flush;
187 cout << label <<
" [";
228 outstr.lhs << label <<
' ';
236 cout <<
outline << endl << std::flush;
253 outstr.lhs <<
_(
"Retrieving:") <<
' ';
260 outstr.rhs <<
'[' <<
_(
"starting") <<
']';
278 cout <<
'.' << std::flush;
287 outstr.lhs <<
_(
"Retrieving:") <<
" ";
295 if ( value >= 0 && value <= 100 )
296 outstr.percentHint = value;
325 outstr.lhs <<
_(
"Retrieving:") <<
" ";
332 if ( zypp::indeterminate(
error ) )
343 outstr.rhs << ( zypp::indeterminate(
error ) ?
_(
"not found") : (
error ?
_(
"error") :
_(
"done") ) );
350 cout <<
outline << endl << std::flush;
369 std::ostringstream
pstr;
386 for (
char ch :
pstr.str() )
394 else if (
ch ==
'\033' )
404 static const size_t resets[] = { 0,3,6,1,4,7,2,5 };
410 std::cout <<
pstr.str() << std::flush;
420 cout <<
_(
"No help available for this prompt.") << endl;
void displayTick(const std::string &s)
void dwnldProgressStart(const zypp::Url &uri) override
Reoprt start of a download.
void error(const std::string &problem_desc, const std::string &hint) override
Show an error message and an optional hint.
OutNormal(Verbosity verbosity=NORMAL)
void progressEnd(const std::string &id, const std::string &label, const std::string &donetag, bool error) override
End of an operation with reported progress.
void prompt(PromptId id, const std::string &prompt, const PromptOptions &poptions, const std::string &startdesc) override
Prompt the user for a decision.
void displayProgress(const std::string &s, int percent)
void infoLine(const TermLine &msg, Verbosity verbosity, Type mask) override
info taking a TermLine
unsigned termwidth() const override
Width for formatted output [0==unlimited].
void dwnldProgress(const zypp::Url &uri, int value, long rate) override
Reports download progress.
bool infoWarningFilter(Verbosity verbosity, Type mask)
void promptHelp(const PromptOptions &poptions) override
Print help for prompt, if available.
void progressStart(const std::string &id, const std::string &label, bool is_tick) override
Start of an operation with reported progress.
void progress(const std::string &id, const std::string &label, int value) override
Progress report for an on-going operation.
void warning(const std::string &msg, Verbosity verbosity, Type mask) override
Show a warning.
void dwnldProgressEnd(const zypp::Url &uri, long rate, zypp::TriBool error) override
Reports end of a download.
bool mine(Type type) override
Determine whether the output is intended for the particular type.
Base class for producing common (for now) zypper output.
Verbosity verbosity() const
Get current verbosity.
virtual unsigned termwidth() const
Width for formatted output [0==unlimited].
Verbosity
Verbosity levels.
@ QUIET
Only important messages (no progress or status, only the result).
@ NORMAL
Default output verbosity level.
virtual bool progressFilter()
Determine whether to show progress.
TypeBit type() const
Return the type of the instance.
virtual std::string zyppExceptionReport(const zypp::Exception &e)
Return a Exception as a string suitable for output.
@ TYPE_NORMAL
plain text output
Example: PromptOptions popts; popts.setOptions(_("y/n/p"), 0 / * default reply * /); popts....
Colored stream output if do_colors.
Colored string if do_colors.
static const std::string & SGRReset()
ANSI SGR sesquence to reset all attributes.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Store and operate with byte count.
Base class for Exception.
std::string basename() const
Return the last component of this path.
String related utilities and Regular expression matching.
const EscapeSequence cursorUP
Cursor up 1 line.
const EscapeSequence clearLN
Clear entire line.
const char * optBlankAfter(const std::string &str_r)
CCString< ColorContext::NEGATIVE > NEGATIVEString
CCString< ColorContext::CHANGE > CHANGEString
std::ostream & PROGRESS_FLUSH(std::ostream &str)
bool do_ttyout()
True unless output is a dumb tty or file.
bool do_colors()
If output is done in colors (depends on config)
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
std::string get() const
Return plain line made of lhs + rhs.