File indexing completed on 2024-05-05 04:39:00
0001 /* 0002 SPDX-FileCopyrightText: 2008 Cédric Pasteur <cedric.pasteur@free.fr> 0003 SPDX-FileCopyrightText: 2001 Matthias Hölzer-Klüpfel <mhk@caldera.de> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef ASTYLESTRINGITERATOR_H 0009 #define ASTYLESTRINGITERATOR_H 0010 0011 #include <QString> 0012 #include <QTextStream> 0013 0014 #include "astyle.h" 0015 0016 #include <string> 0017 0018 class AStyleStringIterator : public astyle::ASSourceIterator 0019 { 0020 public: 0021 explicit AStyleStringIterator(const QString &string); 0022 ~AStyleStringIterator() override; 0023 0024 std::streamoff tellg() override; 0025 int getStreamLength() const override; 0026 bool hasMoreLines() const override; 0027 std::string nextLine(bool emptyLineWasDeleted = false) override; 0028 std::string peekNextLine() override; 0029 void peekReset() override; 0030 std::streamoff getPeekStart() const override; 0031 0032 private: 0033 QString m_content; 0034 QTextStream m_is; 0035 qint64 m_peekStart; 0036 }; 0037 0038 #endif // ASTYLESTRINGITERATOR_H