Rev | Line | |
---|
[1] | 1 | //----------------------------------------------------------- |
---|
| 2 | // Copyright Christian Arnault LAL-Orsay CNRS |
---|
| 3 | // arnault@lal.in2p3.fr |
---|
| 4 | // See the complete license in cmt_license.txt "http://www.cecill.info". |
---|
| 5 | //----------------------------------------------------------- |
---|
| 6 | |
---|
| 7 | //#include <stdio.h> |
---|
| 8 | //#include <stdlib.h> |
---|
| 9 | //#include <stdio.h> |
---|
| 10 | //#include <string.h> |
---|
| 11 | #include "cmt_std.h" |
---|
| 12 | //#include "cmt_string.h" |
---|
| 13 | |
---|
| 14 | #include "cmt_log.h" |
---|
| 15 | #include "cmt.h" |
---|
| 16 | |
---|
| 17 | CmtLog::CmtLog () |
---|
| 18 | { |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | CmtLogEnd& CmtLog::end () |
---|
| 22 | { |
---|
| 23 | static CmtLogEnd me; |
---|
| 24 | |
---|
| 25 | return (me); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | bool CmtLog::check () |
---|
| 29 | { |
---|
| 30 | if (Cmt::get_debug ()) return (true); |
---|
| 31 | return (false); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | CmtLog& CmtLog::operator << (const char* c) |
---|
| 35 | { |
---|
| 36 | if (!check ()) return (*this); |
---|
| 37 | |
---|
| 38 | cout << c; |
---|
| 39 | return (*this); |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | CmtLog& CmtLog::operator << (const cmt_string& s) |
---|
| 43 | { |
---|
| 44 | if (!check ()) return (*this); |
---|
| 45 | |
---|
| 46 | cout << s; |
---|
| 47 | return (*this); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | CmtLog& CmtLog::operator << (int i) |
---|
| 51 | { |
---|
| 52 | if (!check ()) return (*this); |
---|
| 53 | |
---|
| 54 | cout << i; |
---|
| 55 | return (*this); |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | CmtLog& CmtLog::operator << (double d) |
---|
| 59 | { |
---|
| 60 | if (!check ()) return (*this); |
---|
| 61 | |
---|
| 62 | cout << d; |
---|
| 63 | return (*this); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | CmtLog& CmtLog::operator << (void* p) |
---|
| 67 | { |
---|
| 68 | if (!check ()) return (*this); |
---|
| 69 | |
---|
| 70 | cout << p; |
---|
| 71 | return (*this); |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | CmtLog& CmtLog::operator << (CmtLogEnd& end) |
---|
| 75 | { |
---|
| 76 | if (!check ()) return (*this); |
---|
| 77 | |
---|
| 78 | cout << endl; |
---|
| 79 | return (*this); |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | CmtLog& CmtLog::operator << (CmtLogDummy& end) |
---|
| 83 | { |
---|
| 84 | return (*this); |
---|
| 85 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.