summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/odebug.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/odebug.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/odebug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libopie2/opiecore/odebug.h b/libopie2/opiecore/odebug.h
index 85941fd..a5c9ded 100644
--- a/libopie2/opiecore/odebug.h
+++ b/libopie2/opiecore/odebug.h
@@ -26,48 +26,51 @@
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31*/ 31*/
32 32
33#ifndef ODEBUG_H 33#ifndef ODEBUG_H
34#define ODEBUG_H 34#define ODEBUG_H
35 35
36#include <qstring.h> 36#include <qstring.h>
37 37
38class QWidget; 38class QWidget;
39class QDateTime; 39class QDateTime;
40class QDate; 40class QDate;
41class QTime; 41class QTime;
42class QPoint; 42class QPoint;
43class QSize; 43class QSize;
44class QRect; 44class QRect;
45class QRegion; 45class QRegion;
46class QStringList; 46class QStringList;
47class QColor; 47class QColor;
48class QBrush; 48class QBrush;
49 49
50namespace Opie {
51namespace Core {
52
50class odbgstream; 53class odbgstream;
51class ondbgstream; 54class ondbgstream;
52 55
53#ifdef __GNUC__ 56#ifdef __GNUC__
54#define o_funcinfo "[" << __PRETTY_FUNCTION__ << "] " 57#define o_funcinfo "[" << __PRETTY_FUNCTION__ << "] "
55#else 58#else
56#define o_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] " 59#define o_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] "
57#endif 60#endif
58 61
59#define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] " 62#define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] "
60 63
61#define owarn odWarning() 64#define owarn odWarning()
62#define oerr odError() 65#define oerr odError()
63#define odebug odDebug() 66#define odebug odDebug()
64#define ofatal odFatal() 67#define ofatal odFatal()
65#define oendl "\n" 68#define oendl "\n"
66 69
67class odbgstreamprivate; 70class odbgstreamprivate;
68/** 71/**
69 * odbgstream is a text stream that allows you to print debug messages. 72 * odbgstream is a text stream that allows you to print debug messages.
70 * Using the overloaded "<<" operator you can send messages. Usually 73 * Using the overloaded "<<" operator you can send messages. Usually
71 * you do not create the odbgstream yourself, but use @ref odDebug() (odebug) 74 * you do not create the odbgstream yourself, but use @ref odDebug() (odebug)
72 * @ref odWarning() (owarn), @ref odError() (oerr) or @ref odFatal (ofatal) to obtain one. 75 * @ref odWarning() (owarn), @ref odError() (oerr) or @ref odFatal (ofatal) to obtain one.
73 * 76 *
@@ -373,48 +376,52 @@ class ondbgstream {
373 * @return this stream 376 * @return this stream
374 */ 377 */
375 ondbgstream& operator<<(unsigned long) { return *this; } 378 ondbgstream& operator<<(unsigned long) { return *this; }
376 /** 379 /**
377 * Does nothing. 380 * Does nothing.
378 * @return this stream 381 * @return this stream
379 */ 382 */
380 ondbgstream& operator << (QWidget*) { return *this; } 383 ondbgstream& operator << (QWidget*) { return *this; }
381 /** 384 /**
382 * Does nothing. 385 * Does nothing.
383 * @return this stream 386 * @return this stream
384 */ 387 */
385 ondbgstream &form(const char *, ...) { return *this; } 388 ondbgstream &form(const char *, ...) { return *this; }
386 389
387 ondbgstream& operator<<( const QDateTime& ) { return *this; } 390 ondbgstream& operator<<( const QDateTime& ) { return *this; }
388 ondbgstream& operator<<( const QDate& ) { return *this; } 391 ondbgstream& operator<<( const QDate& ) { return *this; }
389 ondbgstream& operator<<( const QTime& ) { return *this; } 392 ondbgstream& operator<<( const QTime& ) { return *this; }
390 ondbgstream& operator<<( const QPoint & ) { return *this; } 393 ondbgstream& operator<<( const QPoint & ) { return *this; }
391 ondbgstream& operator<<( const QSize & ) { return *this; } 394 ondbgstream& operator<<( const QSize & ) { return *this; }
392 ondbgstream& operator<<( const QRect & ) { return *this; } 395 ondbgstream& operator<<( const QRect & ) { return *this; }
393 ondbgstream& operator<<( const QRegion & ) { return *this; } 396 ondbgstream& operator<<( const QRegion & ) { return *this; }
394 ondbgstream& operator<<( const QStringList & ) { return *this; } 397 ondbgstream& operator<<( const QStringList & ) { return *this; }
395 ondbgstream& operator<<( const QColor & ) { return *this; } 398 ondbgstream& operator<<( const QColor & ) { return *this; }
396 ondbgstream& operator<<( const QBrush & ) { return *this; } 399 ondbgstream& operator<<( const QBrush & ) { return *this; }
400
401private:
402 class Private;
403 Private *d;
397}; 404};
398 405
399/*====================================================================================== 406/*======================================================================================
400 * related functions 407 * related functions
401 *======================================================================================*/ 408 *======================================================================================*/
402 409
403/** 410/**
404 * Does nothing. 411 * Does nothing.
405 * @param a stream 412 * @param a stream
406 * @return the given @p s 413 * @return the given @p s
407 */ 414 */
408inline ondbgstream& endl( ondbgstream & s) { return s; } 415inline ondbgstream& endl( ondbgstream & s) { return s; }
409/** 416/**
410 * Does nothing. 417 * Does nothing.
411 * @param a stream 418 * @param a stream
412 * @return the given @p s 419 * @return the given @p s
413 */ 420 */
414inline ondbgstream& flush( ondbgstream & s) { return s; } 421inline ondbgstream& flush( ondbgstream & s) { return s; }
415inline ondbgstream& perror( ondbgstream & s) { return s; } 422inline ondbgstream& perror( ondbgstream & s) { return s; }
416 423
417/** 424/**
418 * Returns a debug stream. You can use it to print debug 425 * Returns a debug stream. You can use it to print debug
419 * information. 426 * information.
420 * @param area an id to identify the output, 0 for default 427 * @param area an id to identify the output, 0 for default
@@ -451,24 +458,26 @@ odbgstream odWarning(bool cond, int area = 0);
451 */ 458 */
452odbgstream odError(int area = 0); 459odbgstream odError(int area = 0);
453odbgstream odError(bool cond, int area = 0); 460odbgstream odError(bool cond, int area = 0);
454/** 461/**
455 * Returns a fatal error stream. You can use it to print fatal error 462 * Returns a fatal error stream. You can use it to print fatal error
456 * information. 463 * information.
457 * @param area an id to identify the output, 0 for default 464 * @param area an id to identify the output, 0 for default
458 */ 465 */
459odbgstream odFatal(int area = 0); 466odbgstream odFatal(int area = 0);
460odbgstream odFatal(bool cond, int area = 0); 467odbgstream odFatal(bool cond, int area = 0);
461 468
462/** 469/**
463 * Deletes the odebugrc cache and therefore forces KDebug to reread the 470 * Deletes the odebugrc cache and therefore forces KDebug to reread the
464 * config file 471 * config file
465 */ 472 */
466void odClearDebugConfig(); 473void odClearDebugConfig();
467 474
468#ifdef OPIE_NO_DEBUG 475#ifdef OPIE_NO_DEBUG
469#define odDebug ondDebug 476#define odDebug ondDebug
470#define odBacktrace ondBacktrace 477#define odBacktrace ondBacktrace
471#endif 478#endif
472 479
473#endif 480#endif
474 481
482}
483}