diff --git a/format.cc b/format.cc index 30d10f77..95ac43e0 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; @@ -721,3 +724,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 07eb5a17..a17cd517 100644 --- a/format.h +++ b/format.h @@ -978,6 +978,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: @@ -1464,8 +1472,12 @@ class Write { inline Formatter Print(StringRef format) { Formatter f(format); return f; -} -} + + + + +}//end namespace internal (?) +}//end namespace format (?) #if _MSC_VER # pragma warning(pop)