diff --git a/format.cc b/format.cc index e2083ecf..05928b4a 100644 --- a/format.cc +++ b/format.cc @@ -423,6 +423,9 @@ void fmt::BasicFormatter::DoFormat() { next_arg_index_ = 0; const Char *s = start; BasicWriter &writer = *writer_; + + // fmt::colour(fmt::Red); + while (*s) { Char c = *s++; if (c != '{' && c != '}') continue; @@ -727,3 +730,11 @@ template void fmt::BasicFormatter::CheckSign( const wchar_t *&s, const Arg &arg); template void fmt::BasicFormatter::DoFormat(); + + + + + void fmt::colour(Colours col) +{ + printf("\033[0;%dm",col); +} diff --git a/format.h b/format.h index eb7b5c8e..ce6d409e 100644 --- a/format.h +++ b/format.h @@ -910,6 +910,14 @@ void FormatCustomArg( the output is sent to a :cpp:class:`fmt::Writer` object. \endrst */ + + +enum Colours{black=30,red,green,yellow,blue,Magenta,cyan,white}; + + void colour(Colours); + + + template class BasicFormatter { private: @@ -1359,8 +1367,12 @@ class Write { inline Formatter Print(StringRef format) { Formatter f(format); return f; -} -} + + + + +}//end namespace internal (?) +}//end namespace format (?) #ifdef FMT_GCC_DIAGNOSTIC # pragma GCC diagnostic pop