This commit is contained in:
Jose Mendez Requena 2014-02-19 21:06:08 +00:00
commit b930333386
2 changed files with 25 additions and 2 deletions

View File

@ -423,6 +423,9 @@ void fmt::BasicFormatter<Char>::DoFormat() {
next_arg_index_ = 0; next_arg_index_ = 0;
const Char *s = start; const Char *s = start;
BasicWriter<Char> &writer = *writer_; BasicWriter<Char> &writer = *writer_;
// fmt::colour(fmt::Red);
while (*s) { while (*s) {
Char c = *s++; Char c = *s++;
if (c != '{' && c != '}') continue; if (c != '{' && c != '}') continue;
@ -721,3 +724,11 @@ template void fmt::BasicFormatter<wchar_t>::CheckSign(
const wchar_t *&s, const Arg &arg); const wchar_t *&s, const Arg &arg);
template void fmt::BasicFormatter<wchar_t>::DoFormat(); template void fmt::BasicFormatter<wchar_t>::DoFormat();
void fmt::colour(Colours col)
{
printf("\033[0;%dm",col);
}

View File

@ -978,6 +978,14 @@ void FormatCustomArg(
the output is sent to a :cpp:class:`fmt::Writer` object. the output is sent to a :cpp:class:`fmt::Writer` object.
\endrst \endrst
*/ */
enum Colours{black=30,red,green,yellow,blue,Magenta,cyan,white};
void colour(Colours);
template <typename Char> template <typename Char>
class BasicFormatter { class BasicFormatter {
private: private:
@ -1464,8 +1472,12 @@ class Write {
inline Formatter<Write> Print(StringRef format) { inline Formatter<Write> Print(StringRef format) {
Formatter<Write> f(format); Formatter<Write> f(format);
return f; return f;
}
}
}//end namespace internal (?)
}//end namespace format (?)
#if _MSC_VER #if _MSC_VER
# pragma warning(pop) # pragma warning(pop)