Correction of 418 (#420)

This commit is contained in:
alabuzhev
2016-11-11 18:27:39 +01:00
committed by Jonathan Müller
parent 1d2049b53e
commit 25f8ad13dd
4 changed files with 22 additions and 26 deletions
-24
View File
@@ -12,30 +12,6 @@
namespace fmt {
namespace {
const char RESET_COLOR[] = "\x1b[0m";
} // namespace
FMT_FUNC void print(std::FILE *f, CStringRef format_str, ArgList args) {
MemoryWriter w;
w.write(format_str, args);
std::fwrite(w.data(), 1, w.size(), f);
}
FMT_FUNC void print(CStringRef format_str, ArgList args) {
print(stdout, format_str, args);
}
FMT_FUNC void print_colored(Color c, CStringRef format, ArgList args) {
char escape[] = "\x1b[30m";
escape[3] = static_cast<char>('0' + c);
std::fputs(escape, stdout);
print(format, args);
std::fputs(RESET_COLOR, stdout);
}
template <typename Char>
void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, ArgList args);