diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/colorizer/colors.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/colorizer/colors.h')
-rw-r--r-- | library/cpp/colorizer/colors.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/colorizer/colors.h b/library/cpp/colorizer/colors.h index 474a918994..4535e8ef37 100644 --- a/library/cpp/colorizer/colors.h +++ b/library/cpp/colorizer/colors.h @@ -1,5 +1,5 @@ #pragma once - + #include "fwd.h" #include <util/generic/string.h> @@ -7,7 +7,7 @@ #include <cstdio> -namespace NColorizer { +namespace NColorizer { /** * List of ECMA-48 colors. * @@ -100,7 +100,7 @@ namespace NColorizer { * All color functions return zero-terminated stringbuf. */ class TColors { - public: + public: static bool CalcIsTTY(FILE* file); public: @@ -193,25 +193,25 @@ namespace NColorizer { TStringBuf WhiteColor() const noexcept; inline bool IsTTY() const noexcept { - return IsTTY_; - } + return IsTTY_; + } inline void SetIsTTY(bool value) noexcept { - IsTTY_ = value; - } - + IsTTY_ = value; + } + inline void Enable() noexcept { - SetIsTTY(true); - } - + SetIsTTY(true); + } + inline void Disable() noexcept { - SetIsTTY(false); - } - - private: - bool IsTTY_; + SetIsTTY(false); + } + + private: + bool IsTTY_; }; - + /// Singletone `TColors` instances for stderr/stdout. TColors& StdErr(); TColors& StdOut(); |