diff options
author | Vasily Gerasimov <UgnineSirdis@gmail.com> | 2022-02-10 16:49:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:10 +0300 |
commit | 1eb755fbca92172a6aec2f57371b2b3a19dfab43 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/colorizer/colors.cpp | |
parent | 6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (diff) | |
download | ydb-1eb755fbca92172a6aec2f57371b2b3a19dfab43.tar.gz |
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/colorizer/colors.cpp')
-rw-r--r-- | library/cpp/colorizer/colors.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/library/cpp/colorizer/colors.cpp b/library/cpp/colorizer/colors.cpp index 47408ac08f..decc5c9847 100644 --- a/library/cpp/colorizer/colors.cpp +++ b/library/cpp/colorizer/colors.cpp @@ -1,6 +1,6 @@ #include "colors.h" -#include <util/stream/output.h> +#include <util/stream/output.h> #include <util/generic/singleton.h> #include <util/system/env.h> @@ -166,10 +166,10 @@ bool TColors::CalcIsTTY(FILE* file) { #endif } -TColors::TColors(FILE* f) +TColors::TColors(FILE* f) : IsTTY_(true) { - SetIsTTY(CalcIsTTY(f)); + SetIsTTY(CalcIsTTY(f)); } TColors::TColors(bool ontty) @@ -418,7 +418,7 @@ TStringBuf TColors::WhiteColor() const noexcept { } -namespace { +namespace { class TStdErrColors: public TColors { public: TStdErrColors() @@ -426,24 +426,24 @@ namespace { { } }; - - class TStdOutColors: public TColors { - public: - TStdOutColors() - : TColors(stdout) - { - } - }; - - class TDisabledColors: public TColors { - public: - TDisabledColors() - : TColors(false) - { - } - }; -} // anonymous namespace - + + class TStdOutColors: public TColors { + public: + TStdOutColors() + : TColors(stdout) + { + } + }; + + class TDisabledColors: public TColors { + public: + TDisabledColors() + : TColors(false) + { + } + }; +} // anonymous namespace + TColors& NColorizer::StdErr() { return *Singleton<TStdErrColors>(); } @@ -453,13 +453,13 @@ TColors& NColorizer::StdOut() { } TColors& NColorizer::AutoColors(IOutputStream& os) { - if (&os == &Cerr) { - return StdErr(); - } - if (&os == &Cout) { - return StdOut(); - } - return *Singleton<TDisabledColors>(); + if (&os == &Cerr) { + return StdErr(); + } + if (&os == &Cout) { + return StdOut(); + } + return *Singleton<TDisabledColors>(); } size_t NColorizer::TotalAnsiEscapeCodeLen(TStringBuf text) { |