Future plan would be to add general flag/var to template dialog
to centrally control creation of API dox.
For now, as API dox is a good standard, have it added hardcoded.
mwolff |
KDevelop |
Future plan would be to add general flag/var to template dialog
to centrally control creation of API dox.
For now, as API dox is a good standard, have it added hardcoded.
No Linters Available |
No Unit Test Coverage |
Example output (updated):
QObject template,
id "KDevelop::Foo"
selected methods to override:
member: "Bar bar"
/* * <one line to give the library's name and an idea of what it does.> * Copyright (C) 2017 Hans Entwickler <email> * * 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. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef KDEVELOP_FOO_H #define KDEVELOP_FOO_H namespace KDevelop { /** * @todo write docs */ class Foo : public QObject { Q_OBJECT Q_PROPERTY(Bar bar READ bar WRITE setBar) public: /** * Default constructor */ Foo(); /** * Destructor */ ~Foo(); /** * @todo write docs * * @param event TODO * @return TODO */ virtual bool event(QEvent* event); /** * @return the bar */ Bar bar() const; public Q_SLOTS: /** * Sets the bar. * * @param bar the new bar */ void setBar(Bar bar); private: Bar m_bar; }; } #endif // KDEVELOP_FOO_H
and
/* * <one line to give the library's name and an idea of what it does.> * Copyright (C) 2017 Hans Entwickler <email> * * 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. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "foo.h" using namespace KDevelop; Foo::Foo() { } Foo::~Foo() { } bool Foo::event(QEvent* event) { } Bar Foo::bar() const { return m_bar; } void Foo::setBar(Bar bar) { m_bar = bar; }
There are still some issues with generated code due to lack of access to data, and also needs more C++11ing...
Left for later for now, this patch should improve things already.
Expect me to keep forging on this :)
Wouldn't it be better to simplify documenting code?
Boilerplate documentation is rather bad, because it makes it seem it's documented, whereas it's not.
The practice I assumed people to follow would be to complete all the TODOs after generation. If people do not do that, that is a problem in their project policies, no? That should be catched at review level :)
At least my goal here is to avoid any unneeded manual code addition and have all places marked that need further editing.
Surely coding principles/styles differ, that's why I envision to soon have a standard toggle in the template dialog which allows to set a var which would be used by all the *_apidox_cpp.txt code to decide if to generate API dox basics or not (thus also the motivation to have this in central files to ease control).