00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef TERMINAL_TOOLS_PRINT_H_
00038 #define TERMINAL_TOOLS_PRINT_H_
00039
00040 #include <stdio.h>
00041 #include <stdarg.h>
00042
00043 #include <pcl/pcl_macros.h>
00044
00045 #define PCL_ALWAYS(...) pcl::console::print (pcl::console::L_ALWAYS, __VA_ARGS__)
00046 #define PCL_ERROR(...) pcl::console::print (pcl::console::L_ERROR, __VA_ARGS__)
00047 #define PCL_WARN(...) pcl::console::print (pcl::console::L_WARN, __VA_ARGS__)
00048 #define PCL_INFO(...) pcl::console::print (pcl::console::L_INFO, __VA_ARGS__)
00049 #define PCL_DEBUG(...) pcl::console::print (pcl::console::L_DEBUG, __VA_ARGS__)
00050 #define PCL_VERBOSE(...) pcl::console::print (pcl::console::L_VERBOSE, __VA_ARGS__)
00051
00052 namespace pcl
00053 {
00054 namespace console
00055 {
00056 enum TT_ATTIBUTES
00057 {
00058 TT_RESET = 0,
00059 TT_BRIGHT = 1,
00060 TT_DIM = 2,
00061 TT_UNDERLINE = 3,
00062 TT_BLINK = 4,
00063 TT_REVERSE = 7,
00064 TT_HIDDEN = 8
00065 };
00066
00067 enum TT_COLORS
00068 {
00069 TT_BLACK,
00070 TT_RED,
00071 TT_GREEN,
00072 TT_YELLOW,
00073 TT_BLUE,
00074 TT_MAGENTA,
00075 TT_CYAN,
00076 TT_WHITE
00077 };
00078
00079 enum VERBOSITY_LEVEL
00080 {
00081 L_ALWAYS,
00082 L_ERROR,
00083 L_WARN,
00084 L_INFO,
00085 L_DEBUG,
00086 L_VERBOSE
00087 };
00088
00090 PCL_EXPORTS void
00091 setVerbosityLevel (VERBOSITY_LEVEL level);
00092
00094 PCL_EXPORTS VERBOSITY_LEVEL
00095 getVerbosityLevel ();
00096
00098 PCL_EXPORTS bool
00099 initVerbosityLevel ();
00100
00102 PCL_EXPORTS bool
00103 isVerbosityLevelEnabled (VERBOSITY_LEVEL severity);
00104
00111 PCL_EXPORTS void
00112 change_text_color (FILE *stream, int attribute, int fg, int bg);
00113
00119 PCL_EXPORTS void
00120 change_text_color (FILE *stream, int attribute, int fg);
00121
00125 PCL_EXPORTS void
00126 reset_text_color (FILE *stream);
00127
00134 PCL_EXPORTS void
00135 print_color (FILE *stream, int attr, int fg, const char *format, ...);
00136
00140 PCL_EXPORTS void
00141 print_info (const char *format, ...);
00142
00147 PCL_EXPORTS void
00148 print_info (FILE *stream, const char *format, ...);
00149
00153 PCL_EXPORTS void
00154 print_highlight (const char *format, ...);
00155
00160 PCL_EXPORTS void
00161 print_highlight (FILE *stream, const char *format, ...);
00162
00166 PCL_EXPORTS void
00167 print_error (const char *format, ...);
00168
00173 PCL_EXPORTS void
00174 print_error (FILE *stream, const char *format, ...);
00175
00179 PCL_EXPORTS void
00180 print_warn (const char *format, ...);
00181
00186 PCL_EXPORTS void
00187 print_warn (FILE *stream, const char *format, ...);
00188
00192 PCL_EXPORTS void
00193 print_debug (const char *format, ...);
00194
00199 PCL_EXPORTS void
00200 print_debug (FILE *stream, const char *format, ...);
00201
00202
00206 PCL_EXPORTS void
00207 print_value (const char *format, ...);
00208
00213 PCL_EXPORTS void
00214 print_value (FILE *stream, const char *format, ...);
00215
00221 PCL_EXPORTS void
00222 print (VERBOSITY_LEVEL level, FILE *stream, const char *format, ...);
00223
00228 PCL_EXPORTS void
00229 print (VERBOSITY_LEVEL level, const char *format, ...);
00230 }
00231 }
00232
00233 #endif