summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/odebug.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libopie2/opiecore/odebug.h b/libopie2/opiecore/odebug.h
index a5c9ded..b040166 100644
--- a/libopie2/opiecore/odebug.h
+++ b/libopie2/opiecore/odebug.h
@@ -1,323 +1,323 @@
/*
This file is part of the Opie Project
(C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de)
Inspired by the KDE debug classes, which are
(C) 1997 Matthias Kalle Dalheimer (kalle@kde.org)
(C) 2002 Holger Freyther (freyther@kde.org)
=.
.=l.
           .>+-=
 _;:,     .>    :=|. This program is free software; you can
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ODEBUG_H
#define ODEBUG_H
#include <qstring.h>
class QWidget;
class QDateTime;
class QDate;
class QTime;
class QPoint;
class QSize;
class QRect;
class QRegion;
class QStringList;
class QColor;
class QBrush;
namespace Opie {
namespace Core {
class odbgstream;
class ondbgstream;
#ifdef __GNUC__
#define o_funcinfo "[" << __PRETTY_FUNCTION__ << "] "
#else
#define o_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] "
#endif
#define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] "
-#define owarn odWarning()
-#define oerr odError()
-#define odebug odDebug()
-#define ofatal odFatal()
+#define owarn Opie::Core::odWarning()
+#define oerr Opie::Core::odError()
+#define odebug Opie::Core::odDebug()
+#define ofatal Opie::Core::odFatal()
#define oendl "\n"
class odbgstreamprivate;
/**
* odbgstream is a text stream that allows you to print debug messages.
* Using the overloaded "<<" operator you can send messages. Usually
* you do not create the odbgstream yourself, but use @ref odDebug() (odebug)
* @ref odWarning() (owarn), @ref odError() (oerr) or @ref odFatal (ofatal) to obtain one.
*
* Example:
* <pre>
* int i = 5;
* odebug << "The value of i is " << i << oendl;
* </pre>
* @see odbgstream
*/
/*======================================================================================
* odbgstream
*======================================================================================*/
class odbgstream
{
public:
/**
* @internal
*/
odbgstream(unsigned int _area, unsigned int _level, bool _print = true);
odbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = true);
odbgstream(odbgstream &str);
odbgstream(const odbgstream &str);
virtual ~odbgstream();
/**
* Prints the given value.
* @param i the boolean to print (as "true" or "false")
* @return this stream
*/
odbgstream &operator<<(bool i);
/**
* Prints the given value.
* @param i the short to print
* @return this stream
*/
odbgstream &operator<<(short i);
/**
* Prints the given value.
* @param i the unsigned short to print
* @return this stream
*/
odbgstream &operator<<(unsigned short i);
/**
* Prints the given value.
* @param i the char to print
* @return this stream
*/
odbgstream &operator<<(char i);
/**
* Prints the given value.
* @param i the unsigned char to print
* @return this stream
*/
odbgstream &operator<<(unsigned char i);
/**
* Prints the given value.
* @param i the int to print
* @return this stream
*/
odbgstream &operator<<(int i);
/**
* Prints the given value.
* @param i the unsigned int to print
* @return this stream
*/
odbgstream &operator<<(unsigned int i);
/**
* Prints the given value.
* @param i the long to print
* @return this stream
*/
odbgstream &operator<<(long i);
/**
* Prints the given value.
* @param i the unsigned long to print
* @return this stream
*/
odbgstream &operator<<(unsigned long i);
/**
* Flushes the output.
*/
virtual void flush();
/**
* Prints the given value.
* @param string the string to print
* @return this stream
*/
odbgstream &operator<<(const QString& string);
/**
* Prints the given value.
* @param string the string to print
* @return this stream
*/
odbgstream &operator<<(const char *string);
/**
* Prints the given value.
* @param string the string to print
* @return this stream
*/
odbgstream &operator<<(const QCString& string);
/**
* Prints the given value.
* @param p a pointer to print (in number form)
* @return this stream
*/
odbgstream& operator<<(const void * p);
/**
* Prints the given value.
* @param d the double to print
* @return this stream
*/
odbgstream& operator<<(double d);
/**
* Prints the string @p format which can contain
* printf-style formatted values.
* @param format the printf-style format
* @return this stream
*/
odbgstream &form(const char *format, ...);
/** Operator to print out basic information about a QWidget.
* Output of class names only works if the class is moc'ified.
* @param widget the widget to print
* @return this stream
*/
odbgstream& operator<< (QWidget* widget);
/**
* Prints the given value.
* @param dateTime the datetime to print
* @return this stream
*/
odbgstream& operator<< ( const QDateTime& dateTime );
/**
* Prints the given value.
* @param date the date to print
* @return this stream
*/
odbgstream& operator<< ( const QDate& date );
/**
* Prints the given value.
* @param time the time to print
* @return this stream
*/
odbgstream& operator<< ( const QTime& time );
/**
* Prints the given value.
* @param point the point to print
* @return this stream
*/
odbgstream& operator<< ( const QPoint& point );
/**
* Prints the given value.
* @param size the QSize to print
* @return this stream
*/
odbgstream& operator<< ( const QSize& size );
/**
* Prints the given value.
* @param rect the QRect to print
* @return this stream
*/
odbgstream& operator<< ( const QRect& rect);
/**
* Prints the given value.
* @param region the QRegion to print
* @return this stream
*/
odbgstream& operator<< ( const QRegion& region);
/**
* Prints the given value.
* @param list the stringlist to print
* @return this stream
*/
odbgstream& operator<< ( const QStringList& list);
/**
* Prints the given value.
* @param color the color to print
* @return this stream
*/
odbgstream& operator<< ( const QColor& color);
/**
* Prints the given value.
* @param brush the brush to print
* @return this stream
*/
odbgstream& operator<< ( const QBrush& brush );
private:
QString output;
unsigned int area, level;
bool print;
odbgstreamprivate* d;
};
/**
* Prints an "\n".
* @param s the debug stream to write to
* @return the debug stream (@p s)
*/
inline odbgstream& endl( odbgstream &s) { s << "\n"; return s; }
/**
* Flushes the stream.
* @param s the debug stream to write to
* @return the debug stream (@p s)
*/
inline odbgstream& flush( odbgstream &s) { s.flush(); return s; }
odbgstream &perror( odbgstream &s);
/**
* ondbgstream is a dummy variant of @ref odbgstream. All functions do
* nothing.
* @see ondDebug()
*/
class ondbgstream {
public:
/// Empty constructor.
ondbgstream() {}
~ondbgstream() {}
/**
* Does nothing.
* @return this stream
*/
ondbgstream &operator<<(short int ) { return *this; }
/**
* Does nothing.
* @return this stream
*/
ondbgstream &operator<<(unsigned short int ) { return *this; }
/**
* Does nothing.
* @return this stream
*/
ondbgstream &operator<<(char ) { return *this; }
/**
* Does nothing.
* @return this stream
*/