summaryrefslogtreecommitdiffstats
path: root/tools/repc/cppcodegenerator.cpp
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan.vatra.ford@kdab.com>2014-11-25 12:47:48 +0200
committerBogDan Vatra <bogdan@kde.org>2014-12-02 11:10:54 +0100
commit56f5a731cb118b9e13920e1edefe9cbc7ead3c15 (patch)
tree7dddb933fbdb062e17ea1529d075f26e559bd9e2 /tools/repc/cppcodegenerator.cpp
parent19e60ec2663e6075db07e5989ab0710421b4a981 (diff)
Add .rep and .h generator from server .h file
Now repc tool can generate client .h files directly from a server .h file. Change-Id: Id94edd56e332a25cd22e226654a77633c2b7272c Reviewed-by: BjΓΆrn Breitmeyer <bjoern.breitmeyer@kdab.com>
Diffstat (limited to 'tools/repc/cppcodegenerator.cpp')
-rw-r--r--tools/repc/cppcodegenerator.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/tools/repc/cppcodegenerator.cpp b/tools/repc/cppcodegenerator.cpp
new file mode 100644
index 0000000..d7d3e78
--- /dev/null
+++ b/tools/repc/cppcodegenerator.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtRemoteObjects module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "cppcodegenerator.h"
+#include "utils.h"
+
+CppCodeGenerator::CppCodeGenerator(QIODevice &outputDevice)
+ : m_outputDevice(outputDevice)
+{
+}
+
+void CppCodeGenerator::generate(const QList<ClassDef> &classList)
+{
+ foreach (const ClassDef &cdef, classList)
+ m_outputDevice.write(generateClass(cdef));
+
+ m_outputDevice.write("\n");
+ m_outputDevice.close();
+}