libzypp 17.37.10

config.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------*/
9#include "config.h"
10#include <cstdlib>
11#include <cstring>
12#include <unistd.h>
13
14 namespace ztui {
15 Config::Config()
16 : do_ttyout ( mayUseANSIEscapes() )
17 , do_colors ( hasANSIColor() )
18 , color_result (ansi::Color::fromString("default"))
19 , color_msgStatus (ansi::Color::fromString("default"))
20 , color_msgError (ansi::Color::fromString("red"))
21 , color_msgWarning (ansi::Color::fromString("purple"))
22 , color_prompt (ansi::Color::fromString("bold"))
23 , color_promptOption(ansi::Color::nocolor()) // follow color_prompt
24 , color_positive (ansi::Color::fromString("green"))
25 , color_change (ansi::Color::fromString("brown"))
26 , color_negative (ansi::Color::fromString("red"))
27 , color_highlight (ansi::Color::fromString("cyan"))
28 , color_lowlight (ansi::Color::fromString("brown"))
29 , color_osdebug (ansi::Color::fromString("default") < ansi::Color::Attr::Reverse)
30 { }
31
32}
ztui::Config::color_osdebug
ansi::Color color_osdebug
Definition config.h:50
ztui::Config::color_promptOption
ansi::Color color_promptOption
Definition config.h:44
ztui::Config::color_msgWarning
ansi::Color color_msgWarning
Definition config.h:42
ztui::Config::color_highlight
ansi::Color color_highlight
Definition config.h:48
ztui::Config::color_negative
ansi::Color color_negative
Definition config.h:47
ztui::Config::color_positive
ansi::Color color_positive
Definition config.h:45
ztui::Config::color_change
ansi::Color color_change
Definition config.h:46
ztui::Config::Config
Config()
Definition config.cc:15
ztui::Config::do_colors
bool do_colors
Whether to colorize the output.
Definition config.h:37
ztui::Config::do_ttyout
bool do_ttyout
True unless output is a dumb tty or file.
Definition config.h:31
ztui::Config::color_lowlight
ansi::Color color_lowlight
Definition config.h:49
ztui::Config::color_msgStatus
ansi::Color color_msgStatus
Definition config.h:40
ztui::Config::color_prompt
ansi::Color color_prompt
Definition config.h:43
ztui::Config::color_msgError
ansi::Color color_msgError
Definition config.h:41
ztui::Config::color_result
ansi::Color color_result
Definition config.h:39
config.h
ztui::ansi
Definition ansi.h:46
ztui
Definition application.cc:13
ztui::mayUseANSIEscapes
bool mayUseANSIEscapes()
Simple check whether stdout is a (not dumb) tty.
Definition colors.cc:37
ztui::hasANSIColor
bool hasANSIColor()
Simple check whether stdout can handle colors.
Definition colors.cc:53
zypp::fromString
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
Definition ResolverFocus.cc:39