Merge 360e0f7602 into 9bb93992b6
This commit is contained in:
commit
b930333386
11
format.cc
11
format.cc
@ -423,6 +423,9 @@ void fmt::BasicFormatter<Char>::DoFormat() {
|
||||
next_arg_index_ = 0;
|
||||
const Char *s = start;
|
||||
BasicWriter<Char> &writer = *writer_;
|
||||
|
||||
// fmt::colour(fmt::Red);
|
||||
|
||||
while (*s) {
|
||||
Char c = *s++;
|
||||
if (c != '{' && c != '}') continue;
|
||||
@ -721,3 +724,11 @@ template void fmt::BasicFormatter<wchar_t>::CheckSign(
|
||||
const wchar_t *&s, const Arg &arg);
|
||||
|
||||
template void fmt::BasicFormatter<wchar_t>::DoFormat();
|
||||
|
||||
|
||||
|
||||
|
||||
void fmt::colour(Colours col)
|
||||
{
|
||||
printf("\033[0;%dm",col);
|
||||
}
|
||||
|
||||
16
format.h
16
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 <typename Char>
|
||||
class BasicFormatter {
|
||||
private:
|
||||
@ -1464,8 +1472,12 @@ class Write {
|
||||
inline Formatter<Write> Print(StringRef format) {
|
||||
Formatter<Write> f(format);
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}//end namespace internal (?)
|
||||
}//end namespace format (?)
|
||||
|
||||
#if _MSC_VER
|
||||
# pragma warning(pop)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user