diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-16 11:45:38 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-12-16 11:45:38 +0000 |
| commit | c39d5de7ae3eaf5927d08b4d40f90dc659aeeff7 (patch) | |
| tree | 8e211c706908d9ec7c8194ab24f83d193a03ec7a /doc/doxyfilter.cpp | |
| parent | 9b2c5b006952448667095472f69bf2da55ec5c87 (diff) | |
| download | qxmpp-c39d5de7ae3eaf5927d08b4d40f90dc659aeeff7.tar.gz | |
add C++ Doxygen filter
Diffstat (limited to 'doc/doxyfilter.cpp')
| -rw-r--r-- | doc/doxyfilter.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
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; +} + |
