Akonadi

cppgenerator.h
1 /*
2  SPDX-FileCopyrightText: 2017 Daniel Vr├ítil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QFile>
10 #include <QTextStream>
11 
12 class Node;
13 class DocumentNode;
14 class ClassNode;
15 class EnumNode;
16 class PropertyNode;
17 
18 class CppGenerator
19 {
20 public:
21  explicit CppGenerator();
22  ~CppGenerator();
23 
24  bool generate(Node const *node);
25 
26 private:
27  bool generateDocument(DocumentNode const *node);
28  bool generateClass(ClassNode const *node);
29 
30 private:
31  void writeHeaderHeader(DocumentNode const *node);
32  void writeHeaderFooter(DocumentNode const *node);
33  void writeHeaderClass(ClassNode const *node);
34  void writeHeaderEnum(EnumNode const *node);
35 
36  void writeImplHeader(DocumentNode const *node);
37  void writeImplFooter(DocumentNode const *node);
38  void writeImplSerializer(DocumentNode const *node);
39  void writeImplClass(ClassNode const *node);
40  void writeImplSerializer(PropertyNode const *node, const char *streamingOperator);
41 
42  void writeImplPropertyDependencies(PropertyNode const *node);
43 
44 private:
45  QFile mHeaderFile;
46  QTextStream mHeader;
47  QFile mImplFile;
48  QTextStream mImpl;
49 };
50 
void generate(const QStringList &source, QStringList &target)
Definition: nodetree.h:12
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:45 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.