1 /*
2     Copyright (c) 2010 Kevin Funk <krf@electrostorm.net>
3 
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Lesser General Public
6     License as published by the Free Software Foundation; either
7     version 2.1 of the License, or (at your option) any later version.
8 
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Lesser General Public License for more details.
13 
14     You should have received a copy of the GNU Lesser General Public
15     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef DEBUGPRIVATE_H
19 #define DEBUGPRIVATE_H
20 
21 #include "Debug.h"
22 
23 #include <QIODevice>
24 #include <QString>
25 
26 class IndentPrivate
27     : public QObject
28 {
29 private:
30     explicit IndentPrivate(QObject* parent = nullptr);
31 
32 public:
33     static IndentPrivate* instance();
34 
35     QString m_string;
36 };
37 
38 class NoDebugStream : public QIODevice
39 {
40 public:
NoDebugStream()41     NoDebugStream()
42     {
43         open(WriteOnly);
44     }
isSequential()45     bool isSequential() const override
46     {
47         return true;
48     }
readData(char *,qint64)49     qint64 readData(char *, qint64) override
50     {
51         return 0;
52     }
readLineData(char *,qint64)53     qint64 readLineData(char *, qint64) override
54     {
55         return 0;
56     }
writeData(const char *,qint64 len)57     qint64 writeData(const char *, qint64 len) override
58     {
59         return len;
60     }
61 };
62 
63 #endif // DEBUGPRIVATE_H
64