blob: e176d507162cf4e9c920e76b5e1c92306691734e (
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
|
// Copyright (C) 2016 Jochen Becher
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "textsource.h"
#include <QString>
namespace qmt {
class QMT_EXPORT StringTextSource : public ITextSource
{
public:
StringTextSource();
~StringTextSource();
void setText(const QString &text);
int sourceId() const { return m_sourceId; }
void setSourceId(int sourceId);
// ITextSource interface
SourceChar readNextChar() override;
private:
QString m_text;
int m_sourceId = -1;
int m_index = -1;
int m_lineNumber = -1;
int m_columnNumber = -1;
};
} // namespace qmt
|