00001 //----------------------------------------------------------- 00002 // Copyright Christian Arnault LAL-Orsay CNRS 00003 // arnault@lal.in2p3.fr 00004 // See the complete license in cmt_license.txt "http://www.cecill.info". 00005 //----------------------------------------------------------- 00006 00007 //#include <stdio.h> 00008 //#include <stdlib.h> 00009 //#include <stdio.h> 00010 //#include <string.h> 00011 #include "cmt_std.h" 00012 //#include "cmt_string.h" 00013 00014 #include "cmt_log.h" 00015 #include "cmt.h" 00016 00017 CmtLog::CmtLog () 00018 { 00019 } 00020 00021 CmtLogEnd& CmtLog::end () 00022 { 00023 static CmtLogEnd me; 00024 00025 return (me); 00026 } 00027 00028 bool CmtLog::check () 00029 { 00030 if (Cmt::get_debug ()) return (true); 00031 return (false); 00032 } 00033 00034 CmtLog& CmtLog::operator << (const char* c) 00035 { 00036 if (!check ()) return (*this); 00037 00038 cout << c; 00039 return (*this); 00040 } 00041 00042 CmtLog& CmtLog::operator << (const cmt_string& s) 00043 { 00044 if (!check ()) return (*this); 00045 00046 cout << s; 00047 return (*this); 00048 } 00049 00050 CmtLog& CmtLog::operator << (int i) 00051 { 00052 if (!check ()) return (*this); 00053 00054 cout << i; 00055 return (*this); 00056 } 00057 00058 CmtLog& CmtLog::operator << (double d) 00059 { 00060 if (!check ()) return (*this); 00061 00062 cout << d; 00063 return (*this); 00064 } 00065 00066 CmtLog& CmtLog::operator << (void* p) 00067 { 00068 if (!check ()) return (*this); 00069 00070 cout << p; 00071 return (*this); 00072 } 00073 00074 CmtLog& CmtLog::operator << (CmtLogEnd& end) 00075 { 00076 if (!check ()) return (*this); 00077 00078 cout << endl; 00079 return (*this); 00080 } 00081 00082 CmtLog& CmtLog::operator << (CmtLogDummy& end) 00083 { 00084 return (*this); 00085 }