summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/odebug.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opiecore/odebug.h b/libopie2/opiecore/odebug.h
index b040166..3851a41 100644
--- a/libopie2/opiecore/odebug.h
+++ b/libopie2/opiecore/odebug.h
@@ -1,483 +1,484 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) 3 (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de)
4 Inspired by the KDE debug classes, which are 4 Inspired by the KDE debug classes, which are
5 (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) 5 (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org)
6 (C) 2002 Holger Freyther (freyther@kde.org) 6 (C) 2002 Holger Freyther (freyther@kde.org)
7 =. 7 =.
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can 10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 12:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
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 { 50namespace Opie {
51namespace Core { 51namespace Core {
52 52
53class odbgstream; 53class odbgstream;
54class ondbgstream; 54class ondbgstream;
55 55
56#ifdef __GNUC__ 56#ifdef __GNUC__
57#define o_funcinfo "[" << __PRETTY_FUNCTION__ << "] " 57#define o_funcinfo "[" << __PRETTY_FUNCTION__ << "] "
58#else 58#else
59#define o_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] " 59#define o_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] "
60#endif 60#endif
61 61
62#define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] " 62#define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] "
63 63
64#define owarn Opie::Core::odWarning() 64#define owarn Opie::Core::odWarning()
65#define oerr Opie::Core::odError() 65#define oerr Opie::Core::odError()
66#define odebug Opie::Core::odDebug() 66#define odebug Opie::Core::odDebug()
67#define ofatal Opie::Core::odFatal() 67#define ofatal Opie::Core::odFatal()
68#define oendl "\n" 68#define oendl "\n"
69 69
70class odbgstreamprivate; 70class odbgstreamprivate;
71/** 71/**
72 * 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.
73 * Using the overloaded "<<" operator you can send messages. Usually 73 * Using the overloaded "<<" operator you can send messages. Usually
74 * 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)
75 * @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.
76 * 76 *
77 * Example: 77 * Example:
78 * <pre> 78 * <pre>
79 * int i = 5; 79 * int i = 5;
80 * odebug << "The value of i is " << i << oendl; 80 * odebug << "The value of i is " << i << oendl;
81 * </pre> 81 * </pre>
82 * @see odbgstream 82 * @see odbgstream
83 */ 83 */
84 84
85/*====================================================================================== 85/*======================================================================================
86 * odbgstream 86 * odbgstream
87 *======================================================================================*/ 87 *======================================================================================*/
88 88
89class odbgstream 89class odbgstream
90{ 90{
91 public: 91 public:
92 /** 92 /**
93 * @internal 93 * @internal
94 */ 94 */
95 odbgstream(unsigned int _area, unsigned int _level, bool _print = true); 95 odbgstream(unsigned int _area, unsigned int _level, bool _print = true);
96 odbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = true); 96 odbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = true);
97 odbgstream(odbgstream &str); 97 odbgstream(odbgstream &str);
98 odbgstream(const odbgstream &str); 98 odbgstream(const odbgstream &str);
99 virtual ~odbgstream(); 99 virtual ~odbgstream();
100 100
101 /** 101 /**
102 * Prints the given value. 102 * Prints the given value.
103 * @param i the boolean to print (as "true" or "false") 103 * @param i the boolean to print (as "true" or "false")
104 * @return this stream 104 * @return this stream
105 */ 105 */
106 odbgstream &operator<<(bool i); 106 odbgstream &operator<<(bool i);
107 /** 107 /**
108 * Prints the given value. 108 * Prints the given value.
109 * @param i the short to print 109 * @param i the short to print
110 * @return this stream 110 * @return this stream
111 */ 111 */
112 odbgstream &operator<<(short i); 112 odbgstream &operator<<(short i);
113 /** 113 /**
114 * Prints the given value. 114 * Prints the given value.
115 * @param i the unsigned short to print 115 * @param i the unsigned short to print
116 * @return this stream 116 * @return this stream
117 */ 117 */
118 odbgstream &operator<<(unsigned short i); 118 odbgstream &operator<<(unsigned short i);
119 /** 119 /**
120 * Prints the given value. 120 * Prints the given value.
121 * @param i the char to print 121 * @param i the char to print
122 * @return this stream 122 * @return this stream
123 */ 123 */
124 odbgstream &operator<<(char i); 124 odbgstream &operator<<(char i);
125 /** 125 /**
126 * Prints the given value. 126 * Prints the given value.
127 * @param i the unsigned char to print 127 * @param i the unsigned char to print
128 * @return this stream 128 * @return this stream
129 */ 129 */
130 odbgstream &operator<<(unsigned char i); 130 odbgstream &operator<<(unsigned char i);
131 /** 131 /**
132 * Prints the given value. 132 * Prints the given value.
133 * @param i the int to print 133 * @param i the int to print
134 * @return this stream 134 * @return this stream
135 */ 135 */
136 odbgstream &operator<<(int i); 136 odbgstream &operator<<(int i);
137 /** 137 /**
138 * Prints the given value. 138 * Prints the given value.
139 * @param i the unsigned int to print 139 * @param i the unsigned int to print
140 * @return this stream 140 * @return this stream
141 */ 141 */
142 odbgstream &operator<<(unsigned int i); 142 odbgstream &operator<<(unsigned int i);
143 /** 143 /**
144 * Prints the given value. 144 * Prints the given value.
145 * @param i the long to print 145 * @param i the long to print
146 * @return this stream 146 * @return this stream
147 */ 147 */
148 odbgstream &operator<<(long i); 148 odbgstream &operator<<(long i);
149 /** 149 /**
150 * Prints the given value. 150 * Prints the given value.
151 * @param i the unsigned long to print 151 * @param i the unsigned long to print
152 * @return this stream 152 * @return this stream
153 */ 153 */
154 odbgstream &operator<<(unsigned long i); 154 odbgstream &operator<<(unsigned long i);
155 /** 155 /**
156 * Flushes the output. 156 * Flushes the output.
157 */ 157 */
158 virtual void flush(); 158 virtual void flush();
159 /** 159 /**
160 * Prints the given value. 160 * Prints the given value.
161 * @param string the string to print 161 * @param string the string to print
162 * @return this stream 162 * @return this stream
163 */ 163 */
164 odbgstream &operator<<(const QString& string); 164 odbgstream &operator<<(const QString& string);
165 /** 165 /**
166 * Prints the given value. 166 * Prints the given value.
167 * @param string the string to print 167 * @param string the string to print
168 * @return this stream 168 * @return this stream
169 */ 169 */
170 odbgstream &operator<<(const char *string); 170 odbgstream &operator<<(const char *string);
171 /** 171 /**
172 * Prints the given value. 172 * Prints the given value.
173 * @param string the string to print 173 * @param string the string to print
174 * @return this stream 174 * @return this stream
175 */ 175 */
176 odbgstream &operator<<(const QCString& string); 176 odbgstream &operator<<(const QCString& string);
177 /** 177 /**
178 * Prints the given value. 178 * Prints the given value.
179 * @param p a pointer to print (in number form) 179 * @param p a pointer to print (in number form)
180 * @return this stream 180 * @return this stream
181 */ 181 */
182 odbgstream& operator<<(const void * p); 182 odbgstream& operator<<(const void * p);
183 /** 183 /**
184 * Prints the given value. 184 * Prints the given value.
185 * @param d the double to print 185 * @param d the double to print
186 * @return this stream 186 * @return this stream
187 */ 187 */
188 odbgstream& operator<<(double d); 188 odbgstream& operator<<(double d);
189 /** 189 /**
190 * Prints the string @p format which can contain 190 * Prints the string @p format which can contain
191 * printf-style formatted values. 191 * printf-style formatted values.
192 * @param format the printf-style format 192 * @param format the printf-style format
193 * @return this stream 193 * @return this stream
194 */ 194 */
195 odbgstream &form(const char *format, ...); 195 odbgstream &form(const char *format, ...);
196 /** Operator to print out basic information about a QWidget. 196 /** Operator to print out basic information about a QWidget.
197 * Output of class names only works if the class is moc'ified. 197 * Output of class names only works if the class is moc'ified.
198 * @param widget the widget to print 198 * @param widget the widget to print
199 * @return this stream 199 * @return this stream
200 */ 200 */
201 odbgstream& operator<< (QWidget* widget); 201 odbgstream& operator<< (QWidget* widget);
202 202
203 /** 203 /**
204 * Prints the given value. 204 * Prints the given value.
205 * @param dateTime the datetime to print 205 * @param dateTime the datetime to print
206 * @return this stream 206 * @return this stream
207 */ 207 */
208 odbgstream& operator<< ( const QDateTime& dateTime ); 208 odbgstream& operator<< ( const QDateTime& dateTime );
209 209
210 /** 210 /**
211 * Prints the given value. 211 * Prints the given value.
212 * @param date the date to print 212 * @param date the date to print
213 * @return this stream 213 * @return this stream
214 */ 214 */
215 odbgstream& operator<< ( const QDate& date ); 215 odbgstream& operator<< ( const QDate& date );
216 216
217 /** 217 /**
218 * Prints the given value. 218 * Prints the given value.
219 * @param time the time to print 219 * @param time the time to print
220 * @return this stream 220 * @return this stream
221 */ 221 */
222 odbgstream& operator<< ( const QTime& time ); 222 odbgstream& operator<< ( const QTime& time );
223 223
224 /** 224 /**
225 * Prints the given value. 225 * Prints the given value.
226 * @param point the point to print 226 * @param point the point to print
227 * @return this stream 227 * @return this stream
228 */ 228 */
229 odbgstream& operator<< ( const QPoint& point ); 229 odbgstream& operator<< ( const QPoint& point );
230 230
231 /** 231 /**
232 * Prints the given value. 232 * Prints the given value.
233 * @param size the QSize to print 233 * @param size the QSize to print
234 * @return this stream 234 * @return this stream
235 */ 235 */
236 odbgstream& operator<< ( const QSize& size ); 236 odbgstream& operator<< ( const QSize& size );
237 237
238 /** 238 /**
239 * Prints the given value. 239 * Prints the given value.
240 * @param rect the QRect to print 240 * @param rect the QRect to print
241 * @return this stream 241 * @return this stream
242 */ 242 */
243 odbgstream& operator<< ( const QRect& rect); 243 odbgstream& operator<< ( const QRect& rect);
244 244
245 /** 245 /**
246 * Prints the given value. 246 * Prints the given value.
247 * @param region the QRegion to print 247 * @param region the QRegion to print
248 * @return this stream 248 * @return this stream
249 */ 249 */
250 odbgstream& operator<< ( const QRegion& region); 250 odbgstream& operator<< ( const QRegion& region);
251 251
252 /** 252 /**
253 * Prints the given value. 253 * Prints the given value.
254 * @param list the stringlist to print 254 * @param list the stringlist to print
255 * @return this stream 255 * @return this stream
256 */ 256 */
257 odbgstream& operator<< ( const QStringList& list); 257 odbgstream& operator<< ( const QStringList& list);
258 258
259 /** 259 /**
260 * Prints the given value. 260 * Prints the given value.
261 * @param color the color to print 261 * @param color the color to print
262 * @return this stream 262 * @return this stream
263 */ 263 */
264 odbgstream& operator<< ( const QColor& color); 264 odbgstream& operator<< ( const QColor& color);
265 265
266 /** 266 /**
267 * Prints the given value. 267 * Prints the given value.
268 * @param brush the brush to print 268 * @param brush the brush to print
269 * @return this stream 269 * @return this stream
270 */ 270 */
271 odbgstream& operator<< ( const QBrush& brush ); 271 odbgstream& operator<< ( const QBrush& brush );
272 272
273 private: 273 private:
274 QString output; 274 QString output;
275 unsigned int area, level; 275 unsigned int area, level;
276 bool print; 276 bool print;
277 odbgstreamprivate* d; 277 odbgstreamprivate* d;
278}; 278};
279 279
280/** 280/**
281 * Prints an "\n". 281 * Prints an "\n".
282 * @param s the debug stream to write to 282 * @param s the debug stream to write to
283 * @return the debug stream (@p s) 283 * @return the debug stream (@p s)
284 */ 284 */
285inline odbgstream& endl( odbgstream &s) { s << "\n"; return s; } 285inline odbgstream& endl( odbgstream &s) { s << "\n"; return s; }
286/** 286/**
287 * Flushes the stream. 287 * Flushes the stream.
288 * @param s the debug stream to write to 288 * @param s the debug stream to write to
289 * @return the debug stream (@p s) 289 * @return the debug stream (@p s)
290 */ 290 */
291inline odbgstream& flush( odbgstream &s) { s.flush(); return s; } 291inline odbgstream& flush( odbgstream &s) { s.flush(); return s; }
292 292
293odbgstream &perror( odbgstream &s); 293odbgstream &perror( odbgstream &s);
294 294
295/** 295/**
296 * ondbgstream is a dummy variant of @ref odbgstream. All functions do 296 * ondbgstream is a dummy variant of @ref odbgstream. All functions do
297 * nothing. 297 * nothing.
298 * @see ondDebug() 298 * @see ondDebug()
299 */ 299 */
300class ondbgstream { 300class ondbgstream {
301 public: 301 public:
302 /// Empty constructor. 302 /// Empty constructor.
303 ondbgstream() {} 303 ondbgstream() {}
304 ~ondbgstream() {} 304 ~ondbgstream() {}
305 /** 305 /**
306 * Does nothing. 306 * Does nothing.
307 * @return this stream 307 * @return this stream
308 */ 308 */
309 ondbgstream &operator<<(short int ) { return *this; } 309 ondbgstream &operator<<(short int ) { return *this; }
310 /** 310 /**
311 * Does nothing. 311 * Does nothing.
312 * @return this stream 312 * @return this stream
313 */ 313 */
314 ondbgstream &operator<<(unsigned short int ) { return *this; } 314 ondbgstream &operator<<(unsigned short int ) { return *this; }
315 /** 315 /**
316 * Does nothing. 316 * Does nothing.
317 * @return this stream 317 * @return this stream
318 */ 318 */
319 ondbgstream &operator<<(char ) { return *this; } 319 ondbgstream &operator<<(char ) { return *this; }
320 /** 320 /**
321 * Does nothing. 321 * Does nothing.
322 * @return this stream 322 * @return this stream
323 */ 323 */
324 ondbgstream &operator<<(unsigned char ) { return *this; } 324 ondbgstream &operator<<(unsigned char ) { return *this; }
325 /** 325 /**
326 * Does nothing. 326 * Does nothing.
327 * @return this stream 327 * @return this stream
328 */ 328 */
329 ondbgstream &operator<<(int ) { return *this; } 329 ondbgstream &operator<<(int ) { return *this; }
330 /** 330 /**
331 * Does nothing. 331 * Does nothing.
332 * @return this stream 332 * @return this stream
333 */ 333 */
334 ondbgstream &operator<<(unsigned int ) { return *this; } 334 ondbgstream &operator<<(unsigned int ) { return *this; }
335 /** 335 /**
336 * Does nothing. 336 * Does nothing.
337 */ 337 */
338 void flush() {} 338 void flush() {}
339 /** 339 /**
340 * Does nothing. 340 * Does nothing.
341 * @return this stream 341 * @return this stream
342 */ 342 */
343 ondbgstream &operator<<(const QString& ) { return *this; } 343 ondbgstream &operator<<(const QString& ) { return *this; }
344 /** 344 /**
345 * Does nothing. 345 * Does nothing.
346 * @return this stream 346 * @return this stream
347 */ 347 */
348 ondbgstream &operator<<(const QCString& ) { return *this; } 348 ondbgstream &operator<<(const QCString& ) { return *this; }
349 /** 349 /**
350 * Does nothing. 350 * Does nothing.
351 * @return this stream 351 * @return this stream
352 */ 352 */
353 ondbgstream &operator<<(const char *) { return *this; } 353 ondbgstream &operator<<(const char *) { return *this; }
354 /** 354 /**
355 * Does nothing. 355 * Does nothing.
356 * @return this stream 356 * @return this stream
357 */ 357 */
358 ondbgstream& operator<<(const void *) { return *this; } 358 ondbgstream& operator<<(const void *) { return *this; }
359 /** 359 /**
360 * Does nothing. 360 * Does nothing.
361 * @return this stream 361 * @return this stream
362 */ 362 */
363 ondbgstream& operator<<(void *) { return *this; } 363 ondbgstream& operator<<(void *) { return *this; }
364 /** 364 /**
365 * Does nothing. 365 * Does nothing.
366 * @return this stream 366 * @return this stream
367 */ 367 */
368 ondbgstream& operator<<(double) { return *this; } 368 ondbgstream& operator<<(double) { return *this; }
369 /** 369 /**
370 * Does nothing. 370 * Does nothing.
371 * @return this stream 371 * @return this stream
372 */ 372 */
373 ondbgstream& operator<<(long) { return *this; } 373 ondbgstream& operator<<(long) { return *this; }
374 /** 374 /**
375 * Does nothing. 375 * Does nothing.
376 * @return this stream 376 * @return this stream
377 */ 377 */
378 ondbgstream& operator<<(unsigned long) { return *this; } 378 ondbgstream& operator<<(unsigned long) { return *this; }
379 /** 379 /**
380 * Does nothing. 380 * Does nothing.
381 * @return this stream 381 * @return this stream
382 */ 382 */
383 ondbgstream& operator << (QWidget*) { return *this; } 383 ondbgstream& operator << (QWidget*) { return *this; }
384 /** 384 /**
385 * Does nothing. 385 * Does nothing.
386 * @return this stream 386 * @return this stream
387 */ 387 */
388 ondbgstream &form(const char *, ...) { return *this; } 388 ondbgstream &form(const char *, ...) { return *this; }
389 389
390 ondbgstream& operator<<( const QDateTime& ) { return *this; } 390 ondbgstream& operator<<( const QDateTime& ) { return *this; }
391 ondbgstream& operator<<( const QDate& ) { return *this; } 391 ondbgstream& operator<<( const QDate& ) { return *this; }
392 ondbgstream& operator<<( const QTime& ) { return *this; } 392 ondbgstream& operator<<( const QTime& ) { return *this; }
393 ondbgstream& operator<<( const QPoint & ) { return *this; } 393 ondbgstream& operator<<( const QPoint & ) { return *this; }
394 ondbgstream& operator<<( const QSize & ) { return *this; } 394 ondbgstream& operator<<( const QSize & ) { return *this; }
395 ondbgstream& operator<<( const QRect & ) { return *this; } 395 ondbgstream& operator<<( const QRect & ) { return *this; }
396 ondbgstream& operator<<( const QRegion & ) { return *this; } 396 ondbgstream& operator<<( const QRegion & ) { return *this; }
397 ondbgstream& operator<<( const QStringList & ) { return *this; } 397 ondbgstream& operator<<( const QStringList & ) { return *this; }
398 ondbgstream& operator<<( const QColor & ) { return *this; } 398 ondbgstream& operator<<( const QColor & ) { return *this; }
399 ondbgstream& operator<<( const QBrush & ) { return *this; } 399 ondbgstream& operator<<( const QBrush & ) { return *this; }
400 400
401private: 401private:
402 class Private; 402 class Private;
403 Private *d; 403 Private *d;
404}; 404};
405 405
406/*====================================================================================== 406/*======================================================================================
407 * related functions 407 * related functions
408 *======================================================================================*/ 408 *======================================================================================*/
409 409
410/** 410/**
411 * Does nothing. 411 * Does nothing.
412 * @param a stream 412 * @param a stream
413 * @return the given @p s 413 * @return the given @p s
414 */ 414 */
415inline ondbgstream& endl( ondbgstream & s) { return s; } 415inline ondbgstream& endl( ondbgstream & s) { return s; }
416/** 416/**
417 * Does nothing. 417 * Does nothing.
418 * @param a stream 418 * @param a stream
419 * @return the given @p s 419 * @return the given @p s
420 */ 420 */
421inline ondbgstream& flush( ondbgstream & s) { return s; } 421inline ondbgstream& flush( ondbgstream & s) { return s; }
422inline ondbgstream& perror( ondbgstream & s) { return s; } 422inline ondbgstream& perror( ondbgstream & s) { return s; }
423 423
424/** 424/**
425 * Returns a debug stream. You can use it to print debug 425 * Returns a debug stream. You can use it to print debug
426 * information. 426 * information.
427 * @param area an id to identify the output, 0 for default 427 * @param area an id to identify the output, 0 for default
428 */ 428 */
429odbgstream odDebug(int area = 0); 429odbgstream odDebug(int area = 0);
430odbgstream odDebug(bool cond, int area = 0); 430odbgstream odDebug(bool cond, int area = 0);
431/** 431/**
432 * Returns a backtrace. 432 * Returns a backtrace.
433 * @param levels the number of levels (-1 for unlimited) of the backtrace 433 * @param levels the number of levels (-1 for unlimited) of the backtrace
434 * @return a backtrace 434 * @return a backtrace
435 */ 435 */
436QString odBacktrace(int levels = -1); 436QString odBacktrace(int levels = -1);
437/** 437/**
438 * Returns a dummy debug stream. The stream does not print anything. 438 * Returns a dummy debug stream. The stream does not print anything.
439 * @param area an id to identify the output, 0 for default 439 * @param area an id to identify the output, 0 for default
440 * @see odDebug() 440 * @see odDebug()
441 */ 441 */
442inline ondbgstream ondDebug(int = 0) { return ondbgstream(); } 442inline ondbgstream ondDebug(int = 0) { return ondbgstream(); }
443inline ondbgstream ondDebug(bool , int = 0) { return ondbgstream(); } 443inline ondbgstream ondDebug(bool , int = 0) { return ondbgstream(); }
444inline QString ondBacktrace() { return QString::null; } 444inline QString ondBacktrace() { return QString::null; }
445inline QString ondBacktrace(int) { return QString::null; } 445inline QString ondBacktrace(int) { return QString::null; }
446 446
447/** 447/**
448 * Returns a warning stream. You can use it to print warning 448 * Returns a warning stream. You can use it to print warning
449 * information. 449 * information.
450 * @param area an id to identify the output, 0 for default 450 * @param area an id to identify the output, 0 for default
451 */ 451 */
452odbgstream odWarning(int area = 0); 452odbgstream odWarning(int area = 0);
453odbgstream odWarning(bool cond, int area = 0); 453odbgstream odWarning(bool cond, int area = 0);
454/** 454/**
455 * Returns an error stream. You can use it to print error 455 * Returns an error stream. You can use it to print error
456 * information. 456 * information.
457 * @param area an id to identify the output, 0 for default 457 * @param area an id to identify the output, 0 for default
458 */ 458 */
459odbgstream odError(int area = 0); 459odbgstream odError(int area = 0);
460odbgstream odError(bool cond, int area = 0); 460odbgstream odError(bool cond, int area = 0);
461/** 461/**
462 * 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
463 * information. 463 * information.
464 * @param area an id to identify the output, 0 for default 464 * @param area an id to identify the output, 0 for default
465 */ 465 */
466odbgstream odFatal(int area = 0); 466odbgstream odFatal(int area = 0);
467odbgstream odFatal(bool cond, int area = 0); 467odbgstream odFatal(bool cond, int area = 0);
468 468
469/** 469/**
470 * Deletes the odebugrc cache and therefore forces KDebug to reread the 470 * Deletes the odebugrc cache and therefore forces KDebug to reread the
471 * config file 471 * config file
472 */ 472 */
473void odClearDebugConfig(); 473void odClearDebugConfig();
474 474
475#ifdef OPIE_NO_DEBUG 475#ifdef OPIE_NO_DEBUG
476#define odDebug ondDebug 476#define odDebug ondDebug
477#define odBacktrace ondBacktrace 477#define odBacktrace ondBacktrace
478#endif 478#endif
479 479
480#endif
481
482} 480}
483} 481}
482
483#endif
484