diff options
author | Renato Araujo Oliveira Filho <renato.filho@openbossa.org> | 2011-02-09 14:22:12 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:13:53 -0300 |
commit | c73c68d7f0cd522ea4b8ecf9e2de4ed040909346 (patch) | |
tree | d1166e71cff6d1f70306c81178f3c5cabd7f8848 /generator | |
parent | cc58fbc15509bd8ed746a7ef3cb3da4cd7055894 (diff) |
Implemented support to iterator function generation.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'generator')
-rw-r--r-- | generator/cppgenerator.cpp | 4 | ||||
-rw-r--r-- | generator/shibokengenerator.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index a2b9aadd7..bc68f6000 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -2536,8 +2536,8 @@ void CppGenerator::writeClassDefinition(QTextStream& s, const AbstractMetaClass* s << INDENT << "/*tp_clear*/ 0," << endl; s << INDENT << "/*tp_richcompare*/ " << tp_richcompare << ',' << endl; s << INDENT << "/*tp_weaklistoffset*/ 0," << endl; - s << INDENT << "/*tp_iter*/ 0," << endl; - s << INDENT << "/*tp_iternext*/ 0," << endl; + s << INDENT << "/*tp_iter*/ " << m_tpFuncs["__iter__"] << ',' << endl; + s << INDENT << "/*tp_iternext*/ " << m_tpFuncs["__next__"] << ',' << endl; s << INDENT << "/*tp_methods*/ " << className << "_methods," << endl; s << INDENT << "/*tp_members*/ 0," << endl; s << INDENT << "/*tp_getset*/ " << tp_getset << ',' << endl; diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp index 387a87690..381e99e04 100644 --- a/generator/shibokengenerator.cpp +++ b/generator/shibokengenerator.cpp @@ -75,6 +75,8 @@ void ShibokenGenerator::clearTpFuncs() { m_tpFuncs["__str__"] = QString("0"); m_tpFuncs["__repr__"] = QString("0"); + m_tpFuncs["__iter__"] = QString("0"); + m_tpFuncs["__next__"] = QString("0"); } void ShibokenGenerator::initPrimitiveTypesCorrespondences() |