100 cerr << endl << hint;
116 cerr << hint << endl;
123 static const bool dbg = getenv(
"ZYPPER_PBD");
124 return (dbg ?
str << std::endl :
str << std::flush );
134 outstr.
lhs << s <<
' ';
137 if ( percent >= 0 && percent <= 100 )
153 cout <<
'.' << std::flush;
166 outstr.
lhs << s <<
' ';
178 cout <<
'.' << std::flush;
188 cout << label <<
" [";
229 outstr.
lhs << label <<
' ';
234 outstr.
rhs << donetag <<
']';
237 cout << outline << endl << std::flush;
254 outstr.
lhs <<
_(
"Retrieving:") <<
' ';
261 outstr.
rhs <<
'[' <<
_(
"starting") <<
']';
279 cout <<
'.' << std::flush;
288 outstr.
lhs <<
_(
"Retrieving:") <<
" ";
296 if ( value >= 0 && value <= 100 )
326 outstr.
lhs <<
_(
"Retrieving:") <<
" ";
333 if ( zypp::indeterminate(
error ) )
341 outstr.
rhs <<
_(
"done");
344 outstr.
rhs << ( zypp::indeterminate(
error ) ?
_(
"not found") : (
error ?
_(
"error") :
_(
"done") ) );
351 cout << outline << endl << std::flush;
362 if ( startdesc.empty() )
368 cout << startdesc << endl;
370 std::ostringstream pstr;
374 if ( ! poptions.
empty() )
387 for (
char ch : pstr.str() )
395 else if ( ch ==
'\033' )
405 static const size_t resets[] = { 0,3,6,1,4,7,2,5 };
406 for (
size_t i = resets[8-invis]; i; --i )
411 std::cout << pstr.
str() << std::flush;
421 cout <<
_(
"No help available for this prompt.") << endl;
427 for (
unsigned idx = 0; idx < poptions.
options().size(); ++idx )
432 cout << ( fopt % ++pos % poptions.
options()[idx] );
435 const std::string & help { poptions.
optionHelp(idx) };
456 if ( !ioctl( 1, TIOCGWINSZ, &wns ) )
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.
Verbosity verbosity() const
Get current verbosity.
Out(TypeBit type, Verbosity verbosity=NORMAL)
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....
const StrVector & options() const
const std::string & optionHelp(unsigned opt) const
ColorString optionString() const
Option string (may have embedded color codes)
bool isDisabled(unsigned opt) const
Colored stream output if do_colors.
std::string str() const
Return a buffered streams content as (colored) string.
Colored string if do_colors.
static const std::string & SGRReset()
ANSI SGR sesquence to reset all attributes.
Store and operate with byte count.
Base class for Exception.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
std::string basename() const
Return the last component of this path.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
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)
zypp::DefaultIntegral< int,-1 > percentHint
std::string get() const
Return plain line made of lhs + rhs.