summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-08-24 11:32:53 -0300
committerHugo Lima <hugo.lima@openbossa.org>2009-08-24 11:32:53 -0300
commit10c15993f817ae2e60afdb4220e841e5104a0e0d (patch)
tree521d9c44d6fb9f8988eb44db5c2fc2decec1b6a3
parent4fca5b868e8b3d982dfa2ceb95806b2a5b2bb639 (diff)
downloadgeneratorrunner-10c15993f817ae2e60afdb4220e841e5104a0e0d.tar.gz
generatorrunner-10c15993f817ae2e60afdb4220e841e5104a0e0d.tar.xz
generatorrunner-10c15993f817ae2e60afdb4220e841e5104a0e0d.zip
Proper initialize m_disableNamedArgs variable.
-rw-r--r--cppgenerator.cpp12
-rw-r--r--cppgenerator.h8
2 files changed, 15 insertions, 5 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index ae1f625..a930bff 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -1419,3 +1419,15 @@ void CppGenerator::writeGlobalFunctions()
s << "}\n";
}
+QMap<QString, QString> CppGenerator::options() const
+{
+ QMap<QString, QString> res;
+ res.insert("disable-named-arg", "Disable Python names arguments.");
+ return res;
+}
+
+bool CppGenerator::prepareGeneration(const QMap<QString, QString>& args)
+{
+ BoostPythonGenerator::prepareGeneration(args);
+ m_disableNamedArgs = args.contains("disable-named-arg");
+}
diff --git a/cppgenerator.h b/cppgenerator.h
index 03d3743..bd41fe1 100644
--- a/cppgenerator.h
+++ b/cppgenerator.h
@@ -32,16 +32,14 @@
class CppGenerator : public BoostPythonGenerator
{
public:
- void setDisableNamedArgs(bool disable)
- {
- m_disableNamedArgs = disable;
- }
-
const char* name() const
{
return "CppGenerator";
}
+ QMap<QString, QString> options() const;
+ bool prepareGeneration(const QMap<QString, QString>& args);
+
protected:
QString fileNameForClass(const AbstractMetaClass *cppClass) const;
void generateClass(QTextStream &s, const AbstractMetaClass *cppClass);