summaryrefslogtreecommitdiffabout
path: root/microkde/kdebug.h
blob: bb9cfe3315bccc91a4cd970e985e0c5d070e4a99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef MINIKDE_KDEBUG_H
#define MINIKDE_KDEBUG_H

#include <stdio.h>

#include <qstring.h>



class kdbgstream;
typedef kdbgstream & (*KDBGFUNC)(kdbgstream &); // manipulator function

class kdbgstream {
 public:
    kdbgstream(unsigned int _area, unsigned int _level, bool _print = true) :
      area(_area), level(_level),  print(  _print ) { print = false; }
    /*   kdbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = false) :
         output(QString::fromLatin1(initialString)), area(_area), level(_level),  print(_print) { print = false; }*/
    ~kdbgstream()
    {
        // if (!output.isEmpty()) {
        // fprintf(stderr,"ASSERT: debug output not ended with \\n\n");
        //*this << "\n";
        //}
    }
   kdbgstream &operator<<(bool)  {

	return *this;
    }
    kdbgstream &operator<<(short)  {

	return *this;
    }
    kdbgstream &operator<<(unsigned short) {
     
        return *this;
    }
    kdbgstream &operator<<(char)  {

	return *this;
    }
    kdbgstream &operator<<(unsigned char) {
       
        return *this;
    }

    kdbgstream &operator<<(int)  {

	return *this;
    }
    kdbgstream &operator<<(unsigned int) {
      
        return *this;
    }
    kdbgstream &operator<<(long) {
        return *this;
    }
    kdbgstream &operator<<(unsigned long) {
        return *this;
    }
    kdbgstream &operator<<(const QString&) {
	return *this;
    }
    kdbgstream &operator<<(const char*) {
	return *this;
    }
    kdbgstream &operator<<(const QCString&) {
      return *this;
    }
    kdbgstream& operator<<(KDBGFUNC f) {
	return (*f)(*this);
    }
    kdbgstream& operator<<(double) {
	if (!print) return *this;
      return *this;
    }
    void flush() {
	return;
    }
 private:
    QString output;
    unsigned int area, level;
    bool print;
};

inline kdbgstream &endl( kdbgstream &s) { s << "\n"; return s; }

inline kdbgstream kdDebug(int area = 0) { return kdbgstream(area, 0); }
inline kdbgstream kdWarning(int area = 0) { return kdbgstream(area, 0); }
inline kdbgstream kdError(int area = 0) { return kdbgstream(area, 0); }

#endif