KOSMIndoorMap

mapcssparser.h
1 /*
2  SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KOSMINDOORMAP_MAPCSSPARSER_H
8 #define KOSMINDOORMAP_MAPCSSPARSER_H
9 
10 #include "kosmindoormap_export.h"
11 
12 #include "mapcsstypes.h"
13 
14 #include <QString>
15 
16 namespace KOSMIndoorMap { class MapCSSParser; }
17 int yyparse(KOSMIndoorMap::MapCSSParser*, void*);
18 struct YYLTYPE;
19 typedef void* yyscan_t;
20 void yyerror(YYLTYPE*, KOSMIndoorMap::MapCSSParser*, yyscan_t, char const*);
21 
22 namespace KOSMIndoorMap {
23 
24 class MapCSSStyle;
25 class MapCSSRule;
26 
27 /** MapCSS parser. */
28 class KOSMINDOORMAP_EXPORT MapCSSParser
29 {
30 public:
31  MapCSSStyle parse(const QString &fileName);
32 
33  bool hasError() const;
34  QString fileName() const;
35  QString errorMessage() const;
36 
37 private:
38  friend int ::yyparse(KOSMIndoorMap::MapCSSParser*, void*);
39  friend void ::yyerror(YYLTYPE*, KOSMIndoorMap::MapCSSParser*, yyscan_t, char const*);
40 
41  void parse(MapCSSStyle *style, const QString &fileName);
42 
43  /** @internal for use by the generated parser only. */
44  bool addImport(char *fileName);
45  void addRule(MapCSSRule *rule);
46  void setError(const QString &msg, int line, int column);
47 
48  ClassSelectorKey makeClassSelector(const char *str, std::size_t len);
49  LayerSelectorKey makeLayerSelector(const char *str, std::size_t len);
50 
51  MapCSSStyle *m_currentStyle = nullptr;
52  QString m_currentFileName;
53  bool m_error = false;
54  QString m_errorMsg;
55  int m_line = 0;
56  int m_column = 0;
57 };
58 
59 }
60 
61 #endif // KOSMINDOORMAP_MAPCSSPARSER_H
OSM-based multi-floor indoor maps for buildings.
A parsed MapCSS style sheet.
Definition: mapcssstyle.h:29
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:03:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.