diff options
Diffstat (limited to 'src/third_party/benchmark-1.4.1/benchmark/src/colorprint.h')
-rw-r--r-- | src/third_party/benchmark-1.4.1/benchmark/src/colorprint.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/third_party/benchmark-1.4.1/benchmark/src/colorprint.h b/src/third_party/benchmark-1.4.1/benchmark/src/colorprint.h new file mode 100644 index 00000000000..9f6fab9b342 --- /dev/null +++ b/src/third_party/benchmark-1.4.1/benchmark/src/colorprint.h @@ -0,0 +1,33 @@ +#ifndef BENCHMARK_COLORPRINT_H_ +#define BENCHMARK_COLORPRINT_H_ + +#include <cstdarg> +#include <iostream> +#include <string> + +namespace benchmark { +enum LogColor { + COLOR_DEFAULT, + COLOR_RED, + COLOR_GREEN, + COLOR_YELLOW, + COLOR_BLUE, + COLOR_MAGENTA, + COLOR_CYAN, + COLOR_WHITE +}; + +std::string FormatString(const char* msg, va_list args); +std::string FormatString(const char* msg, ...); + +void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, + va_list args); +void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...); + +// Returns true if stdout appears to be a terminal that supports colored +// output, false otherwise. +bool IsColorTerminal(); + +} // end namespace benchmark + +#endif // BENCHMARK_COLORPRINT_H_ |