File indexing completed on 2024-11-17 04:17:27
0001 /* 0002 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOSMINDOORMAP_MAPCSSPARSER_P_H 0008 #define KOSMINDOORMAP_MAPCSSPARSER_P_H 0009 0010 #include "mapcsstypes.h" 0011 0012 #include <QString> 0013 0014 namespace KOSMIndoorMap { 0015 0016 class MapCSSStyle; 0017 class MapCSSRule; 0018 0019 class MapCSSParserPrivate 0020 { 0021 public: 0022 void parse(MapCSSStyle *style, const QString &fileName, ClassSelectorKey importClass); 0023 0024 /** @internal for use by the generated parser only. */ 0025 [[nodiscard]] bool addImport(char *fileName, ClassSelectorKey importClass); 0026 void addRule(MapCSSRule *rule); 0027 void setError(const QString &msg, int line, int column); 0028 0029 [[nodiscard]] ClassSelectorKey makeClassSelector(const char *str, std::size_t len) const; 0030 [[nodiscard]] LayerSelectorKey makeLayerSelector(const char *str, std::size_t len) const; 0031 0032 MapCSSStyle *m_currentStyle = nullptr; 0033 QString m_currentFileName; 0034 ClassSelectorKey m_importClass; 0035 bool m_error = false; 0036 QString m_errorMsg; 0037 int m_line = 0; 0038 int m_column = 0; 0039 }; 0040 0041 } 0042 0043 #endif