Refactor action classes, Action -> Sink, add comments.
This commit is contained in:
@@ -688,12 +688,13 @@ void fmt::BasicWriter<Char>::FormatParser::Format(
|
||||
writer.buffer_.append(start, s);
|
||||
}
|
||||
|
||||
void fmt::ColorWriter::operator()(const fmt::BasicWriter<char> &w) const {
|
||||
void fmt::ANSITerminalSink::operator()(
|
||||
const fmt::BasicWriter<char> &w) const {
|
||||
char escape[] = "\x1b[30m";
|
||||
escape[3] = '0' + static_cast<char>(color_);
|
||||
std::fputs(escape, stdout);
|
||||
std::fwrite(w.data(), 1, w.size(), stdout);
|
||||
std::fputs(RESET_COLOR, stdout);
|
||||
std::fputs(escape, file_);
|
||||
std::fwrite(w.data(), 1, w.size(), file_);
|
||||
std::fputs(RESET_COLOR, file_);
|
||||
}
|
||||
|
||||
// Explicit instantiations for char.
|
||||
|
||||
Reference in New Issue
Block a user