-rw-r--r-- | libopie2/opiecore/odebug.h | 9 |
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 | ||
38 | class QWidget; | 38 | class QWidget; |
39 | class QDateTime; | 39 | class QDateTime; |
40 | class QDate; | 40 | class QDate; |
41 | class QTime; | 41 | class QTime; |
42 | class QPoint; | 42 | class QPoint; |
43 | class QSize; | 43 | class QSize; |
44 | class QRect; | 44 | class QRect; |
45 | class QRegion; | 45 | class QRegion; |
46 | class QStringList; | 46 | class QStringList; |
47 | class QColor; | 47 | class QColor; |
48 | class QBrush; | 48 | class QBrush; |
49 | 49 | ||
50 | namespace Opie { | ||
51 | namespace Core { | ||
52 | |||
50 | class odbgstream; | 53 | class odbgstream; |
51 | class ondbgstream; | 54 | class 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 | ||
67 | class odbgstreamprivate; | 70 | class 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 | |||
401 | private: | ||
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 | */ |
408 | inline ondbgstream& endl( ondbgstream & s) { return s; } | 415 | inline 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 | */ |
414 | inline ondbgstream& flush( ondbgstream & s) { return s; } | 421 | inline ondbgstream& flush( ondbgstream & s) { return s; } |
415 | inline ondbgstream& perror( ondbgstream & s) { return s; } | 422 | inline 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 | */ |
452 | odbgstream odError(int area = 0); | 459 | odbgstream odError(int area = 0); |
453 | odbgstream odError(bool cond, int area = 0); | 460 | odbgstream 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 | */ |
459 | odbgstream odFatal(int area = 0); | 466 | odbgstream odFatal(int area = 0); |
460 | odbgstream odFatal(bool cond, int area = 0); | 467 | odbgstream 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 | */ |
466 | void odClearDebugConfig(); | 473 | void 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 | } | ||