| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> |
| 3 | |
| 4 | SPDX-License-Identifier: MIT |
| 5 | */ |
| 6 | |
| 7 | #ifndef KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H |
| 8 | #define KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H |
| 9 | |
| 10 | #include <QStringView> |
| 11 | |
| 12 | namespace KSyntaxHighlighting |
| 13 | { |
| 14 | class Context; |
| 15 | class DefinitionData; |
| 16 | |
| 17 | class ContextSwitch |
| 18 | { |
| 19 | public: |
| 20 | ContextSwitch() = default; |
| 21 | ~ContextSwitch() = default; |
| 22 | |
| 23 | bool isStay() const |
| 24 | { |
| 25 | return m_isStay; |
| 26 | } |
| 27 | |
| 28 | int popCount() const |
| 29 | { |
| 30 | return m_popCount; |
| 31 | } |
| 32 | |
| 33 | Context *context() const |
| 34 | { |
| 35 | return m_context; |
| 36 | } |
| 37 | |
| 38 | void resolve(DefinitionData &def, QStringView context); |
| 39 | |
| 40 | private: |
| 41 | Context *m_context = nullptr; |
| 42 | int m_popCount = 0; |
| 43 | bool m_isStay = true; |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | #endif // KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H |
| 48 | |