Akonadi

cppgenerator.h
1/*
2 SPDX-FileCopyrightText: 2017 Daniel Vrátil <dvratil@kde.og>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QFile>
10#include <QTextStream>
11
12class Node;
13class DocumentNode;
14class ClassNode;
15class EnumNode;
16class PropertyNode;
17
18class CppGenerator
19{
20public:
21 explicit CppGenerator();
22 ~CppGenerator();
23
24 bool generate(Node const *node);
25
26private:
27 bool generateDocument(DocumentNode const *node);
28 bool generateClass(ClassNode const *node);
29
30private:
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
44private:
45 QFile mHeaderFile;
46 QTextStream mHeader;
47 QFile mImplFile;
48 QTextStream mImpl;
49};
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.