File indexing completed on 2024-05-19 04:49:32

0001 /*
0002     Copyright (c) 2010 Kevin Funk <krf@electrostorm.net>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) any later version.
0008 
0009     This library is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012     Lesser General Public License for more details.
0013 
0014     You should have received a copy of the GNU Lesser General Public
0015     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0016 */
0017 
0018 #ifndef DEBUGPRIVATE_H
0019 #define DEBUGPRIVATE_H
0020 
0021 #include "Debug.h"
0022 
0023 #include <QIODevice>
0024 #include <QString>
0025 
0026 class IndentPrivate
0027     : public QObject
0028 {
0029 private:
0030     explicit IndentPrivate(QObject* parent = nullptr);
0031 
0032 public:
0033     static IndentPrivate* instance();
0034 
0035     QString m_string;
0036 };
0037 
0038 class NoDebugStream : public QIODevice
0039 {
0040 public:
0041     NoDebugStream()
0042     {
0043         open(WriteOnly);
0044     }
0045     bool isSequential() const override
0046     {
0047         return true;
0048     }
0049     qint64 readData(char *, qint64) override
0050     {
0051         return 0;
0052     }
0053     qint64 readLineData(char *, qint64) override
0054     {
0055         return 0;
0056     }
0057     qint64 writeData(const char *, qint64 len) override
0058     {
0059         return len;
0060     }
0061 };
0062 
0063 #endif // DEBUGPRIVATE_H