libzypp 17.37.17
|
Namespaces | |
namespace | ansi |
namespace | csidetail |
namespace | ctcdetail |
namespace | env |
namespace | mbs |
namespace | out |
namespace | table |
namespace | text |
namespace | utf8 |
Classes | |
class | AliveCursor |
class | Application |
struct | CCString |
class | ColorStream |
Colored stream output if do_colors. More... | |
class | ColorString |
Colored string if do_colors. More... | |
class | Config |
class | Out |
Base class for producing common (for now) zypper output. More... | |
class | OutNormal |
class | PromptOptions |
Example:
PromptOptions popts;
popts.setOptions(_("y/n/p"), 0 / * default reply * /);
popts.setOptionHelp(0, _("Help for option 'y'"));
popts.setOptionHelp(1, _("Help for option 'n'"));
...
zypper.out().prompt(PROMPT_YN_INST_REMOVE_CONTINUE, prompt_text, popts);
unsigned reply =
get_prompt_reply(zypper, PROMPT_YN_INST_REMOVE_CONTINUE, popts);
More... | |
class | PropertyTable |
Aligned key/value with multiline support Key : value 1 LongKey : value 2 Multiline : line 1 line 2 Next Key : value 3. More... | |
class | Table |
class | TableHeader |
class | TableRow |
struct | TermLine |
Typedefs | |
using | SolvableCSI = std::pair<zypp::sat::Solvable, zypp::ui::Selectable::picklist_size_type> |
Custom sort index type for table rows representing solvables (like detailed search results). | |
using | DEFAULTString = CCString<ColorContext::DEFAULT> |
using | MSG_STATUSString = CCString<ColorContext::MSG_STATUS> |
using | MSG_ERRORString = CCString<ColorContext::MSG_ERROR> |
using | MSG_WARNINGString = CCString<ColorContext::MSG_WARNING> |
using | POSITIVEString = CCString<ColorContext::POSITIVE> |
using | CHANGEString = CCString<ColorContext::CHANGE> |
using | NEGATIVEString = CCString<ColorContext::NEGATIVE> |
using | HIGHLIGHTString = CCString<ColorContext::HIGHLIGHT> |
using | LOWLIGHTString = CCString<ColorContext::LOWLIGHT> |
Enumerations | |
enum class | ProgressEnd { done , attention , error } |
ProgressBars default end tags. More... | |
enum | TableLineStyle { Ascii = 0 , Light , Heavy , Double , Light3 , Heavy3 , LightHeavy , LightDouble , HeavyLight , DoubleLight , Colon , none , TLS_End } |
table drawing style More... | |
enum class | ColorContext { DEFAULT , RESULT , MSG_STATUS , MSG_ERROR , MSG_WARNING , PROMPT , PROMPT_OPTION , POSITIVE , CHANGE , NEGATIVE , HIGHLIGHT , LOWLIGHT , OSDEBUG } |
enum | tags { PARAGRAPH , PRE , BLOCKQUOTE , BOLD , UNDERLINED , ANCHOR , HEADER1 , HEADER2 , HEADER3 , BREAK_LINE , EM , ITALIC , HR , LI , OL , UL , TT , QT , BIG , CODE , CENTER , UNKNOWN } |
Functions | |
ZYPP_DECLARE_OPERATORS_FOR_FLAGS (TermLine::SplitFlags) | |
ZYPP_DECLARE_OPERATORS_FOR_FLAGS (Out::Type) | |
std::ostream & | PROGRESS_FLUSH (std::ostream &str) |
const char * | asYesNo (bool val_r) |
template<class Tif_, class Telse_> | |
auto | ColumnIf (bool condition_r, Tif_ &&if_r, Telse_ &&else_r) -> ctcdetail::ColumnIf< decltype(if_r()), decltype(else_r())> |
Conditional Table column factory. | |
template<class Tif_> | |
auto | ColumnIf (bool condition_r, Tif_ &&if_r) -> ctcdetail::ColumnIf< decltype(if_r()), decltype(if_r())> |
template<class Tp_> | |
TableRow && | operator<< (TableRow &&tr, Tp_ &&val) |
template<class Tif_, class Telse_> | |
TableRow & | operator<< (TableRow &tr, const ctcdetail::ColumnIf< Tif_, Telse_ > &val) |
template<class Tif_, class Telse_> | |
TableRow & | operator<< (TableRow &tr, ctcdetail::ColumnIf< Tif_, Telse_ > &val) |
template<class Tif_, class Telse_> | |
TableRow & | operator<< (TableRow &tr, ctcdetail::ColumnIf< Tif_, Telse_ > &&val) |
template<class Tif_> | |
TableRow & | operator<< (TableRow &tr, const ctcdetail::ColumnIf< Tif_, Tif_ > &val) |
template<class Tif_> | |
TableRow & | operator<< (TableRow &tr, ctcdetail::ColumnIf< Tif_, Tif_ > &val) |
template<class Tif_> | |
TableRow & | operator<< (TableRow &tr, ctcdetail::ColumnIf< Tif_, Tif_ > &&val) |
template<class Tp_> | |
TableHeader && | operator<< (TableHeader &&th, Tp_ &&val) |
Table & | operator<< (Table &table, TableRow tr) |
Table & | operator<< (Table &table, TableHeader tr) |
std::ostream & | operator<< (std::ostream &stream, const Table &table) |
bool | do_ttyout () |
True unless output is a dumb tty or file. | |
bool | do_colors () |
If output is done in colors (depends on config) | |
bool | mayUseANSIEscapes () |
Simple check whether stdout is a (not dumb) tty. | |
bool | hasANSIColor () |
Simple check whether stdout can handle colors. | |
ansi::ColorStream | operator<< (ansi::Color color_r, std::ostream &(*omanip)(std::ostream &)) |
template<class CCC_, typename = ansi::EnableIfCustomColorCtor<CCC_>> | |
ansi::ColorStream | operator<< (CCC_ &&color_r, std::ostream &(*omanip)(std::ostream &)) |
ansi::Color | customColorCtor (ColorContext ctxt_r) |
template<ColorContext _ctxt> | |
ansi::ColorStream & | operator<< (ansi::ColorStream &cstr_r, const CCString< _ctxt > &cstring_r) |
std::string | readline_getline () |
Use readline to get line of input. | |
unsigned | get_screen_width () |
Reads COLUMNS environment variable or gets the screen width from readline, in that order. | |
void | clear_keyboard_buffer () |
Clear the keyboard buffer. | |
void | fillTagmap () |
std::string | closeTag (std::vector< tags > &tagStack) |
std::string | openTag (std::vector< tags > &tagStack, std::string &tag) |
void | fillAmpersmap () |
std::string | getStringFromAmpr (const std::string &str) |
std::string | processRichText (const std::string &text) |
std::ostream & | printRichText (std::ostream &str, std::string text, unsigned indent_r=0U, unsigned width_r=0U) |
Print [Rich]Text optionally indented. | |
std::string | printRichText (std::string text, unsigned indent_r=0U, unsigned width_r=0U) |
Return [Rich]Text optionally indented as string. | |
std::string | mbs_substr_by_width (boost::string_ref text_r, std::string::size_type colpos_r=0, std::string::size_type collen_r=std::string::npos) |
Returns a substring of a multi-byte character string text_r starting at screen column cpos_r and being at most clen_r columns wide. | |
void | mbs_write_wrapped (std::ostream &out, boost::string_ref text_r, size_t indent_r, size_t wrap_r, int indentFix_r=0) |
Wrap and indent given text and write it to the output stream out. | |
void | mbs_write_wrapped (std::ostream &out, const zypp::str::Str &text_r, size_t indent_r, size_t wrap_r, int indentFix_r=0) |
size_t | mbs_width (boost::string_ref text_r) |
Returns the column width of a multi-byte character string text_r. | |
template<class Tp_> | |
TableRow & | operator<< (TableRow &tr, Tp_ &&val) |
Add colummn. | |
template<class Tp_> | |
TableHeader & | operator<< (TableHeader &th, Tp_ &&val) |
Add column. |
Variables | |
static constexpr int | ZTUI_EXIT_OK = 0 |
static const char * | lines [][3] |
std::map< std::string, tags > | _rtTagmap |
bool | pre |
bool | ordered |
unsigned | count_list_items |
std::map< std::string, std::string > | ampersmap |
using ztui::SolvableCSI = std::pair<zypp::sat::Solvable, zypp::ui::Selectable::picklist_size_type> |
|
strong |
enum ztui::TableLineStyle |
|
strong |
enum ztui::tags |
Enumerator | |
---|---|
PARAGRAPH | |
PRE | |
BLOCKQUOTE | |
BOLD | |
UNDERLINED | |
ANCHOR | |
HEADER1 | |
HEADER2 | |
HEADER3 | |
BREAK_LINE | |
EM | |
ITALIC | |
HR | |
LI | |
OL | |
UL | |
TT | |
QT | |
BIG | |
CODE | |
CENTER | |
UNKNOWN |
Definition at line 26 of file richtext.cc.
ztui::ZYPP_DECLARE_OPERATORS_FOR_FLAGS | ( | TermLine::SplitFlags | ) |
ztui::ZYPP_DECLARE_OPERATORS_FOR_FLAGS | ( | Out::Type | ) |
|
inline |
Definition at line 122 of file OutNormal.cc.
auto ztui::ColumnIf | ( | bool | condition_r, |
Tif_ && | if_r, | ||
Telse_ && | else_r ) -> ctcdetail::ColumnIf<decltype(if_r()),decltype(else_r())> |
Conditional Table column factory.
Creates an conditional TableRow or TableHeader entry, depending on the value of condition_r. The columns content, if needed, is determined calling the function object matching the condition.
An empty function object will cause the column to be hidden and no content will be retrieved (see overloaded operator<<(TableRow &,..)).
auto ztui::ColumnIf | ( | bool | condition_r, |
Tif_ && | if_r ) -> ctcdetail::ColumnIf<decltype(if_r()),decltype(if_r())> |
TableRow & ztui::operator<< | ( | TableRow & | tr, |
const ctcdetail::ColumnIf< Tif_, Telse_ > & | val ) |
TableRow & ztui::operator<< | ( | TableRow & | tr, |
ctcdetail::ColumnIf< Tif_, Telse_ > & | val ) |
TableRow & ztui::operator<< | ( | TableRow & | tr, |
ctcdetail::ColumnIf< Tif_, Telse_ > && | val ) |
TableRow & ztui::operator<< | ( | TableRow & | tr, |
const ctcdetail::ColumnIf< Tif_, Tif_ > & | val ) |
TableRow & ztui::operator<< | ( | TableRow & | tr, |
ctcdetail::ColumnIf< Tif_, Tif_ > & | val ) |
TableRow & ztui::operator<< | ( | TableRow & | tr, |
ctcdetail::ColumnIf< Tif_, Tif_ > && | val ) |
TableHeader && ztui::operator<< | ( | TableHeader && | th, |
Tp_ && | val ) |
|
inline |
|
inline |
bool ztui::do_ttyout | ( | ) |
bool ztui::do_colors | ( | ) |
bool ztui::mayUseANSIEscapes | ( | ) |
bool ztui::hasANSIColor | ( | ) |
|
inline |
|
inline |
ansi::Color ztui::customColorCtor | ( | ColorContext | ctxt_r | ) |
|
inline |
std::string ztui::readline_getline | ( | ) |
Use readline to get line of input.
Definition at line 26 of file console.cc.
unsigned ztui::get_screen_width | ( | ) |
Reads COLUMNS environment variable or gets the screen width from readline, in that order.
Falls back to 80 if all that fails.
\NOTE In case stdout is not connected to a terminal max. unsigned is returned. This should prevent clipping when output is redirected.
Definition at line 48 of file console.cc.
void ztui::clear_keyboard_buffer | ( | ) |
Clear the keyboard buffer.
Useful before showing the user prompt message to catch any unwanted <enter> key hits (bnc #649248).
\NOTE This will not clear characters typed after the last
Definition at line 74 of file console.cc.
void ztui::fillTagmap | ( | ) |
Definition at line 58 of file richtext.cc.
std::string ztui::closeTag | ( | std::vector< tags > & | tagStack | ) |
Definition at line 89 of file richtext.cc.
std::string ztui::openTag | ( | std::vector< tags > & | tagStack, |
std::string & | tag ) |
Definition at line 111 of file richtext.cc.
void ztui::fillAmpersmap | ( | ) |
Definition at line 166 of file richtext.cc.
std::string ztui::getStringFromAmpr | ( | const std::string & | str | ) |
Definition at line 176 of file richtext.cc.
std::string ztui::processRichText | ( | const std::string & | text | ) |
Definition at line 205 of file richtext.cc.
|
inline |
Print [Rich]Text optionally indented.
Richtext is introduced by a '' or '
'(bsc#935885) tag.
Definition at line 26 of file richtext.h.
|
inline |
Return [Rich]Text optionally indented as string.
Definition at line 41 of file richtext.h.
std::string ztui::mbs_substr_by_width | ( | boost::string_ref | text_r, |
std::string::size_type | colpos_r = 0, | ||
std::string::size_type | collen_r = std::string::npos ) |
|
inline |
Wrap and indent given text and write it to the output stream out.
TODO
out | output stream to write to |
test | text to wrap |
indent | number of columns by which to indent the whole text |
wrap | number of columns the text should be wrapped into |
indentFix | additional indent/outdent for the first line (default: 0 ) |
|
inline |
|
inline |
|
staticconstexpr |
Definition at line 24 of file application.h.
|
static |
std::map<std::string,tags> ztui::_rtTagmap |
Definition at line 52 of file richtext.cc.
bool ztui::pre |
Definition at line 54 of file richtext.cc.
bool ztui::ordered |
Definition at line 55 of file richtext.cc.
unsigned ztui::count_list_items |
Definition at line 56 of file richtext.cc.
std::map<std::string,std::string> ztui::ampersmap |
Definition at line 164 of file richtext.cc.