summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 16:57:35 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 18:39:53 -0300
commit2f9545f876f13cf53d795c488d04dd4cdfd654af (patch)
tree1a7cc22d73b0904caf7265bbd5668d31217b69b8
parentbc4b77ef8cc4f17973d416c44521c65b66bc2bc7 (diff)
downloadshiboken-2f9545f876f13cf53d795c488d04dd4cdfd654af.tar.gz
shiboken-2f9545f876f13cf53d795c488d04dd4cdfd654af.tar.xz
shiboken-2f9545f876f13cf53d795c488d04dd4cdfd654af.zip
Add extra options for ShibokenGenerator::writeBaseConversion.
-rw-r--r--shibokengenerator.cpp9
-rw-r--r--shibokengenerator.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index ebfe58e5..81a05762 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -310,7 +310,7 @@ void ShibokenGenerator::writeBaseConversion(QTextStream& s, const TypeEntry* typ
}
void ShibokenGenerator::writeBaseConversion(QTextStream& s, const AbstractMetaType* type,
- const AbstractMetaClass* context)
+ const AbstractMetaClass* context, Options options)
{
QString typeName;
if (type->isPrimitive()) {
@@ -333,7 +333,7 @@ void ShibokenGenerator::writeBaseConversion(QTextStream& s, const AbstractMetaTy
if (typeName.startsWith("const ") && type->name() != "char")
typeName.remove(0, sizeof("const ") / sizeof(char) - 1);
- if (typeName.endsWith("&") && (tentry->isPrimitive() || tentry->isContainer()))
+ if ((options & ExcludeReference || tentry->isPrimitive() || tentry->isContainer()) && typeName.endsWith('&'))
typeName.chop(1);
s << baseConversionString(typeName);
@@ -360,9 +360,10 @@ void ShibokenGenerator::writeToCppConversion(QTextStream& s, const AbstractMetaC
}
void ShibokenGenerator::writeToCppConversion(QTextStream& s, const AbstractMetaType* type,
- const AbstractMetaClass* context, const QString& argumentName)
+ const AbstractMetaClass* context, const QString& argumentName,
+ Options options)
{
- writeBaseConversion(s, type, context);
+ writeBaseConversion(s, type, context, options);
s << "toCpp(" << argumentName << ')';
}
diff --git a/shibokengenerator.h b/shibokengenerator.h
index 8653a8ed..7c8a5d39 100644
--- a/shibokengenerator.h
+++ b/shibokengenerator.h
@@ -199,13 +199,13 @@ public:
const AbstractMetaClass* getMultipleInheritingClass(const AbstractMetaClass* metaClass);
void writeBaseConversion(QTextStream& s, const AbstractMetaType* type,
- const AbstractMetaClass* context);
+ const AbstractMetaClass* context, Options options = NoOption);
/// Simpler version of writeBaseConversion, uses only the base name of the type.
void writeBaseConversion(QTextStream& s, const TypeEntry* type);
void writeToPythonConversion(QTextStream& s, const AbstractMetaType* type,
const AbstractMetaClass* context, const QString& argumentName = QString());
void writeToCppConversion(QTextStream& s, const AbstractMetaType* type,
- const AbstractMetaClass* context, const QString& argumentName);
+ const AbstractMetaClass* context, const QString& argumentName, Options options = NoOption);
void writeToCppConversion(QTextStream& s, const AbstractMetaClass* metaClass, const QString& argumentName);
/// Verifies if the class should have a C++ wrapper generated for it, instead of only a Python wrapper.