Cppcheck
color.h
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2023 Cppcheck team.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef colorH
20 #define colorH
21 
22 #include "config.h"
23 
24 #include <ostream>
25 #include <string>
26 
27 enum class Color {
28  Reset = 0,
29  Bold = 1,
30  Dim = 2,
31  FgRed = 31,
32  FgGreen = 32,
33  FgBlue = 34,
34  FgMagenta = 35,
35  FgDefault = 39
36 };
37 CPPCHECKLIB std::ostream& operator<<(std::ostream& os, Color c);
38 
39 CPPCHECKLIB std::string toString(Color c);
40 
41 extern CPPCHECKLIB bool gDisableColors; // for testing
42 
43 #endif
CPPCHECKLIB std::ostream & operator<<(std::ostream &os, Color c)
Definition: color.cpp:43
CPPCHECKLIB std::string toString(Color c)
Definition: color.cpp:54
Color
Definition: color.h:27
@ FgMagenta
@ FgDefault
CPPCHECKLIB bool gDisableColors
Definition: color.cpp:28
#define CPPCHECKLIB
Definition: config.h:35