diff options
Diffstat (limited to 'src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h')
-rw-r--r-- | src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h b/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h index 074b9478be..e2a9e1fc68 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause <vkrause@kde.org> - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> + + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_FOLDINGREGION_H @@ -28,8 +11,8 @@ #include <QTypeInfo> -namespace KSyntaxHighlighting { - +namespace KSyntaxHighlighting +{ /** Represents a begin or end of a folding region. * @since 5.28 */ class KSYNTAXHIGHLIGHTING_EXPORT FoldingRegion @@ -39,7 +22,7 @@ public: * Defines whether a FoldingRegion starts or ends a folding region. */ enum Type { - //! Used internally as indicator for invalid FoldingRegion%s. + //! Used internally as indicator for an invalid FoldingRegion. None, //! Indicates the start of a FoldingRegion. Begin, @@ -81,7 +64,7 @@ public: * brace, you need to do kind of a reference counting to find the correct * closing brace. */ - quint16 id() const; + int id() const; /** * Returns whether this is the begin or end of a region. @@ -91,12 +74,21 @@ public: */ Type type() const; + /** + * Returns the matching start or end region. + * + * @note Will return invalid region for an invalid region. + * + * @since 6.0 + */ + FoldingRegion sibling() const; + private: friend class Rule; - FoldingRegion(Type type, quint16 id); + KSYNTAXHIGHLIGHTING_NO_EXPORT FoldingRegion(Type type, int id); - quint16 m_type : 2; - quint16 m_id: 14; + // 0 is invalid, positive begin, negative end + int m_idWithType = 0; }; } |