print.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2010, Willow Garage, Inc.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of Willow Garage, Inc. nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  * $Id: print.h 6126 2012-07-03 20:19:58Z aichim $
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


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:17:24