aboutsummaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-28 15:48:27 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:17 -0300
commit52fdebcb0b3822180a374ee821f3503d746656c1 (patch)
tree3fd0757a3a5efb0bc3688838c817bb72f10299da /generator
parentc6b9bb836c98a6bcf922ad6ad4dda60e3383d41b (diff)
Update string usage to new Shiboken::String API.
Diffstat (limited to 'generator')
-rw-r--r--generator/cppgenerator.cpp2
-rw-r--r--generator/shibokengenerator.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 35e9d2639..458a34d16 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -3720,7 +3720,7 @@ void CppGenerator::writeGetattroFunction(QTextStream& s, const AbstractMetaClass
s << INDENT << '}' << endl;
foreach (const AbstractMetaFunction* func, getMethodsWithBothStaticAndNonStaticMethods(metaClass)) {
- s << INDENT << "if (SBK_PyString_CompareWithASCIIString(name, \"" << func->name() << "\") == 0)" << endl;
+ s << INDENT << "if (Shiboken::String::compare(name, \"" << func->name() << "\") == 0)" << endl;
Indentation indent(INDENT);
s << INDENT << "return PyCFunction_NewEx(&" << cpythonMethodDefinitionName(func) << ", " PYTHON_SELF_VAR ", 0);" << endl;
}
diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp
index 0be94bc6f..64c941460 100644
--- a/generator/shibokengenerator.cpp
+++ b/generator/shibokengenerator.cpp
@@ -903,11 +903,13 @@ QString ShibokenGenerator::cpythonCheckFunction(const AbstractMetaType* metaType
if (isNumber(baseName))
return genericNumberType ? QString("SbkNumber_Check") : QString("%1_Check").arg(baseName);
+
baseName.clear();
QTextStream b(&baseName);
// exclude const on Objects
Options flags = getConverterOptions(metaType);
writeBaseConversion(b, metaType, 0, flags);
+
return QString("%1checkType").arg(baseName);
}
@@ -941,6 +943,9 @@ QString ShibokenGenerator::guessCPythonCheckFunction(const QString& type, Abstra
if (type == "PyBuffer")
return "Shiboken::Buffer::checkType";
+ if (type == "str")
+ return "Shiboken::String::check";
+
*metaType = buildAbstractMetaTypeFromString(type);
if (*metaType && !(*metaType)->typeEntry()->isCustom())
return QString();