26 #include "tdelibs_export.h"
59 #define k_funcinfo "[" << __PRETTY_FUNCTION__ << "] "
61 #define k_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] "
64 #define k_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] "
66 class kdbgstreamprivate;
85 kdbgstream(
unsigned int _area,
unsigned int _level,
bool _print =
true) :
86 area(_area), level(_level), print(_print) { }
87 kdbgstream(
const char * initialString,
unsigned int _area,
unsigned int _level,
bool _print =
true) :
88 output(TQString::fromLatin1(initialString)), area(_area), level(_level), print(_print) { }
92 output(str.output), area(str.area), level(str.level), print(str.print) {}
100 if (!print)
return *
this;
101 output += TQString::fromLatin1(i ?
"true" :
"false");
110 if (!print)
return *
this;
111 TQString tmp; tmp.setNum(i); output += tmp;
120 if (!print)
return *
this;
121 TQString tmp; tmp.setNum(i); output += tmp;
136 return operator<<( static_cast<char>( ch ) );
144 if (!print)
return *
this;
145 TQString tmp; tmp.setNum(i); output += tmp;
154 if (!print)
return *
this;
155 TQString tmp; tmp.setNum(i); output += tmp;
164 if (!print)
return *
this;
165 TQString tmp; tmp.setNum(i); output += tmp;
174 if (!print)
return *
this;
175 TQString tmp; tmp.setNum(i); output += tmp;
184 if (!print)
return *
this;
185 TQString tmp; tmp.setNum(i); output += tmp;
194 if (!print)
return *
this;
195 TQString tmp; tmp.setNum(i); output += tmp;
217 if (!print)
return *
this;
219 if (output.at(output.length() -1 ) == (TQChar)
'\n')
229 if (!print)
return *
this;
230 output += TQString::fromUtf8(
string);
231 if (output.at(output.length() - 1) == (TQChar)
'\n')
241 *
this <<
string.data();
259 if (!print)
return *
this;
268 TQString tmp; tmp.setNum(d); output += tmp;
279 __attribute__ ( ( format ( printf, 2, 3 ) ) )
288 kdbgstream& operator<< (
const TQWidget* widget);
296 kdbgstream& operator<< (
const TQDateTime& dateTime );
303 kdbgstream& operator<< (
const TQDate& date );
310 kdbgstream& operator<< (
const TQTime& time );
317 kdbgstream& operator<< (
const TQPoint& point );
324 kdbgstream& operator<< (
const TQSize& size );
338 kdbgstream& operator<< (
const TQRegion& region);
353 kdbgstream& operator<< (
const TQStringList& list);
360 kdbgstream& operator<< (
const TQColor& color);
375 kdbgstream& operator<< (
const TQBrush& brush );
383 kdbgstream& operator<< (
const TQVariant& variant );
391 kdbgstream& operator<< (
const TQByteArray& data );
400 kdbgstream& operator<< (
const TQValueList<T> &list );
404 unsigned int area, level;
406 kdbgstreamprivate* d;
413 typename TQValueList<T>::ConstIterator it = list.begin();
414 if ( !list.isEmpty() ) {
417 for ( ; it != list.end(); ++it ) {
552 kndbgstream& operator<< (TQWidget*) {
return *
this; }
559 kndbgstream& operator<<(
const TQDateTime& ) {
return *
this; }
560 kndbgstream& operator<<(
const TQDate& ) {
return *
this; }
561 kndbgstream& operator<<(
const TQTime& ) {
return *
this; }
562 kndbgstream& operator<<(
const TQPoint & ) {
return *
this; }
563 kndbgstream& operator<<(
const TQSize & ) {
return *
this; }
564 kndbgstream& operator<<(
const TQRect & ) {
return *
this; }
565 kndbgstream& operator<<(
const TQRegion & ) {
return *
this; }
567 kndbgstream& operator<<(
const TQStringList & ) {
return *
this; }
568 kndbgstream& operator<<(
const TQColor & ) {
return *
this; }
569 kndbgstream& operator<<(
const TQPen & ) {
return *
this; }
570 kndbgstream& operator<<(
const TQBrush & ) {
return *
this; }
571 kndbgstream& operator<<(
const TQVariant & ) {
return *
this; }
572 kndbgstream& operator<<(
const TQByteArray & ) {
return *
this; }
575 kndbgstream& operator<<(
const TQValueList<T> & ) {
return *
this; }
608 TDECORE_EXPORT TQString
kdBacktrace(
int levels=-1);
661 #define kdDebug kndDebug
Represents and parses a URL.
kdbgstream is a text stream that allows you to print debug messages.
kdbgstream & operator<<(int i)
Prints the given value.
kdbgstream & operator<<(unsigned long i)
Prints the given value.
void flush()
Flushes the output.
kdbgstream & operator<<(const char *string)
Prints the given value.
kdbgstream & operator<<(long i)
Prints the given value.
kdbgstream & operator<<(const void *p)
Prints the given value.
kdbgstream & operator<<(unsigned int i)
Prints the given value.
kdbgstream & operator<<(bool i)
Prints the given value.
kdbgstream & operator<<(short i)
Prints the given value.
kdbgstream & operator<<(unsigned short i)
Prints the given value.
kdbgstream & operator<<(TQ_LLONG i)
Prints the given value.
kdbgstream & operator<<(double d)
Prints the given value.
kdbgstream & operator<<(unsigned char ch)
Prints the given value.
kdbgstream & operator<<(const TQCString &string)
Prints the given value.
kdbgstream & operator<<(KDBGFUNC f)
Invokes the given function.
kdbgstream & operator<<(TQ_ULLONG i)
Prints the given value.
kdbgstream & operator<<(const TQString &string)
Prints the given value.
kndbgstream is a dummy variant of kdbgstream.
kndbgstream & operator<<(const TQString &)
Does nothing.
kndbgstream & operator<<(TQChar)
Does nothing.
kndbgstream & operator<<(unsigned long)
Does nothing.
kndbgstream & operator<<(KNDBGFUNC)
Does nothing.
kndbgstream & operator<<(void *)
Does nothing.
kndbgstream & operator<<(long)
Does nothing.
kndbgstream & operator<<(const void *)
Does nothing.
kndbgstream & operator<<(unsigned short int)
Does nothing.
kndbgstream & operator<<(double)
Does nothing.
kndbgstream & operator<<(short int)
Does nothing.
void flush()
Does nothing.
kndbgstream & operator<<(unsigned int)
Does nothing.
kndbgstream & operator<<(TQ_LLONG)
Does nothing.
kndbgstream & operator<<(unsigned char)
Does nothing.
kndbgstream & operator<<(const TQCString &)
Does nothing.
kndbgstream & form(const char *,...)
Does nothing.
kndbgstream & operator<<(const char *)
Does nothing.
kndbgstream & operator<<(char)
Does nothing.
kndbgstream & operator<<(int)
Does nothing.
kndbgstream & operator<<(TQ_ULLONG)
Does nothing.
kndbgstream()
Default constructor.
kdbgstream kdFatal(int area=0)
Returns a fatal error stream.
void kdBacktraceFD(int fd=2)
Writes a backtrace to the given file descriptor.
TQString kdBacktrace(int levels=-1)
Returns a backtrace.
kdbgstream & flush(kdbgstream &s)
Flushes the stream.
kdbgstream kdWarning(int area=0)
Returns a warning stream.
void kdClearDebugConfig()
Deletes the kdebugrc cache and therefore forces KDebug to reread the config file.
kdbgstream kdError(int area=0)
Returns an error stream.
kndbgstream kndDebug(int area=0)
Returns a dummy debug stream.
kdbgstream kdDebug(int area=0)
Returns a debug stream.
kndbgstream & flush(kndbgstream &s)
Does nothing.
kdbgstream & endl(kdbgstream &s)
Prints an "\n".