| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> |
| 3 | |
| 4 | SPDX-License-Identifier: MIT |
| 5 | */ |
| 6 | |
| 7 | #ifndef KSYNTAXHIGHLIGHTING_XML_P_H |
| 8 | #define KSYNTAXHIGHLIGHTING_XML_P_H |
| 9 | |
| 10 | #include <QString> |
| 11 | |
| 12 | namespace KSyntaxHighlighting |
| 13 | { |
| 14 | /** Utilities for XML parsing. */ |
| 15 | namespace Xml |
| 16 | { |
| 17 | /** Parse a xs:boolean attribute. */ |
| 18 | inline bool attrToBool(QStringView str) |
| 19 | { |
| 20 | return str == QStringLiteral("1" ) || str.compare(QStringLiteral("true" ), cs: Qt::CaseInsensitive) == 0; |
| 21 | } |
| 22 | |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | #endif |
| 27 | |