aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-12-16 11:45:38 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-12-16 11:45:38 +0000
commitc39d5de7ae3eaf5927d08b4d40f90dc659aeeff7 (patch)
tree8e211c706908d9ec7c8194ab24f83d193a03ec7a /doc
parent9b2c5b006952448667095472f69bf2da55ec5c87 (diff)
downloadqxmpp-c39d5de7ae3eaf5927d08b4d40f90dc659aeeff7.tar.gz
add C++ Doxygen filter
Diffstat (limited to 'doc')
-rw-r--r--doc/doc.pro6
-rw-r--r--doc/doxyfilter.cpp53
2 files changed, 59 insertions, 0 deletions
diff --git a/doc/doc.pro b/doc/doc.pro
new file mode 100644
index 00000000..ed4fd1b0
--- /dev/null
+++ b/doc/doc.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+CONFIG += console
+QT -= gui
+
+TARGET = ../doxyfilter
+SOURCES += doxyfilter.cpp
diff --git a/doc/doxyfilter.cpp b/doc/doxyfilter.cpp
new file mode 100644
index 00000000..7cb28320
--- /dev/null
+++ b/doc/doxyfilter.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008-2010 The QXmpp developers
+ *
+ * Author:
+ * Jeremy Lainé
+ *
+ * Source:
+ * http://code.google.com/p/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#include <cstdlib>
+
+#include <QCoreApplication>
+#include <QFile>
+#include <QRegExp>
+#include <QTextStream>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+ if (argc != 2) {
+ qWarning("Usage: doxyfilter <sourcefile>");
+ return 1;
+ }
+
+ // read source code
+ QFile source(QString::fromLocal8Bit(argv[1]));
+ if (!source.open(QIODevice::ReadOnly)) {
+ qWarning("Could not open %s", qPrintable(source.fileName()));
+ return 1;
+ }
+ QString code = QString::fromUtf8(source.readAll());
+
+ // add links for XEPs
+ code.replace(QRegExp("(XEP-([0-9]{4}))"), "<a href=\"http://xmpp.org/extensions/xep-\\2.html\">\\1</a>");
+ QTextStream output(stdout);
+ output << code;
+ return 0;
+}
+