aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-22 13:25:44 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-23 16:30:15 +0100
commit9e19ebd9c90999368dbf2db1a5e7b44cc2ddf7fa (patch)
tree0befee52fefe0e12af49fca26d2f47552c1e0c9c /sources
parent31de5e520d69d47d9710ad8b97aee62ce053916f (diff)
shiboken6: Make more functions static using clang tidy
Apply the fix created by clang tidy' -wreadability-convert-member-functions-to-static warning with some manual correction. Change-Id: I394bd96881fa25dbcb7a725b79d10395fcbb8676 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h30
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractor.h12
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp4
-rw-r--r--sources/shiboken6/ApiExtractor/docparser.cpp6
-rw-r--r--sources/shiboken6/ApiExtractor/docparser.h11
-rw-r--r--sources/shiboken6/ApiExtractor/parser/codemodel.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/parser/codemodel.h3
-rw-r--r--sources/shiboken6/ApiExtractor/qtdocparser.h14
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.h2
-rw-r--r--sources/shiboken6/generator/generator.cpp6
-rw-r--r--sources/shiboken6/generator/generator.h10
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp2
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinx.h4
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp33
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.h47
-rw-r--r--sources/shiboken6/generator/shiboken/headergenerator.cpp4
-rw-r--r--sources/shiboken6/generator/shiboken/headergenerator.h4
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.cpp37
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.h69
19 files changed, 162 insertions, 138 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
index cbabfe724..975e294b4 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
@@ -103,7 +103,7 @@ public:
AbstractMetaClass::Attributes *constructorAttributes,
AbstractMetaClass *currentClass);
void traverseFunctions(ScopeModelItem item, AbstractMetaClass *parent);
- void applyFunctionModifications(AbstractMetaFunction* func);
+ static void applyFunctionModifications(AbstractMetaFunction *func);
void traverseFields(const ScopeModelItem &item, AbstractMetaClass *parent);
bool traverseStreamOperator(const FunctionModelItem &functionItem,
AbstractMetaClass *currentClass);
@@ -135,18 +135,20 @@ public:
* said class.
* \param metaFunction conversion operator function to be fixed.
*/
- void fixReturnTypeOfConversionOperator(AbstractMetaFunction *metaFunction);
+ static void fixReturnTypeOfConversionOperator(AbstractMetaFunction *metaFunction);
void parseQ_Properties(AbstractMetaClass *metaClass, const QStringList &declarations);
void setupEquals(AbstractMetaClass *metaClass);
void setupComparable(AbstractMetaClass *metaClass);
- void setupClonable(AbstractMetaClass *cls);
+ static void setupClonable(AbstractMetaClass *cls);
void setupExternalConversion(AbstractMetaClass *cls);
- void setupFunctionDefaults(AbstractMetaFunction *metaFunction,
- AbstractMetaClass *metaClass);
+ static void setupFunctionDefaults(AbstractMetaFunction *metaFunction,
+ AbstractMetaClass *metaClass);
- QString fixDefaultValue(const ArgumentModelItem &item, const AbstractMetaType &type,
- const AbstractMetaClass *, int argumentIndex);
+ static QString fixDefaultValue(const ArgumentModelItem &item,
+ const AbstractMetaType &type,
+ const AbstractMetaClass *,
+ int argumentIndex);
std::optional<AbstractMetaType>
translateType(const TypeInfo &type, const AbstractMetaClass *currentClass,
TranslateTypeFlags flags = {}, QString *errorMessage = nullptr);
@@ -170,21 +172,21 @@ public:
AbstractMetaClassList getBaseClasses(const AbstractMetaClass *metaClass) const;
bool ancestorHasPrivateCopyConstructor(const AbstractMetaClass *metaClass) const;
- bool inheritTemplate(AbstractMetaClass *subclass,
- const AbstractMetaClass *templateClass,
- const TypeInfo &info);
+ static bool inheritTemplate(AbstractMetaClass *subclass,
+ const AbstractMetaClass *templateClass,
+ const TypeInfo &info);
void inheritTemplateFunctions(AbstractMetaClass *subclass);
std::optional<AbstractMetaType>
inheritTemplateType(const AbstractMetaTypeList &templateTypes,
const AbstractMetaType &metaType);
- bool isQObject(const FileModelItem &dom, const QString &qualifiedName);
- bool isEnum(const FileModelItem &dom, const QStringList &qualifiedName);
+ static bool isQObject(const FileModelItem &dom, const QString &qualifiedName);
+ static bool isEnum(const FileModelItem &dom, const QStringList &qualifiedName);
void sortLists();
- AbstractMetaArgumentList reverseList(const AbstractMetaArgumentList &list);
+ static AbstractMetaArgumentList reverseList(const AbstractMetaArgumentList &list);
void setInclude(TypeEntry *te, const QString &path) const;
- void fixArgumentNames(AbstractMetaFunction *func, const FunctionModificationList &mods);
+ static void fixArgumentNames(AbstractMetaFunction *func, const FunctionModificationList &mods);
void fillAddedFunctions(AbstractMetaClass *metaClass);
const AbstractMetaClass *resolveTypeSystemTypeDef(const AbstractMetaType &t) const;
diff --git a/sources/shiboken6/ApiExtractor/apiextractor.h b/sources/shiboken6/ApiExtractor/apiextractor.h
index 36d40f21d..a3d25540a 100644
--- a/sources/shiboken6/ApiExtractor/apiextractor.h
+++ b/sources/shiboken6/ApiExtractor/apiextractor.h
@@ -69,16 +69,16 @@ public:
void setCppFileNames(const QFileInfoList &cppFileNames);
QFileInfoList cppFileNames() const { return m_cppFileNames; }
void setSkipDeprecated(bool value);
- void setSuppressWarnings(bool value);
- void setSilent(bool value);
- void addTypesystemSearchPath(const QString& path);
- void addTypesystemSearchPath(const QStringList& paths);
+ static void setSuppressWarnings(bool value);
+ static void setSilent(bool value);
+ static void addTypesystemSearchPath(const QString &path);
+ static void addTypesystemSearchPath(const QStringList& paths);
void addIncludePath(const HeaderPath& path);
void addIncludePath(const HeaderPaths& paths);
HeaderPaths includePaths() const { return m_includePaths; }
void setLogDirectory(const QString& logDir);
- bool setApiVersion(const QString& package, const QString& version);
- void setDropTypeEntries(const QStringList &dropEntries);
+ static bool setApiVersion(const QString &package, const QString &version);
+ static void setDropTypeEntries(const QStringList &dropEntries);
LanguageLevel languageLevel() const;
void setLanguageLevel(LanguageLevel languageLevel);
QStringList clangOptions() const;
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
index cf489eb2e..6da41d6b9 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
@@ -195,7 +195,7 @@ public:
TemplateParameterModelItem createNonTypeTemplateParameter(const CXCursor &cursor) const;
void addField(const CXCursor &cursor);
- QString cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor) const;
+ static QString cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor);
void addBaseClass(const CXCursor &cursor);
template <class Item>
@@ -651,7 +651,7 @@ void BuilderPrivate::endTemplateTypeAlias(const CXCursor &typeAliasCursor)
// extract an expression from the cursor via source
// CXCursor_EnumConstantDecl, ParmDecl (a = Flag1 | Flag2)
-QString BuilderPrivate::cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor) const
+QString BuilderPrivate::cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor)
{
const std::string_view snippet = bv->getCodeSnippet(cursor);
auto equalSign = snippet.find('=');
diff --git a/sources/shiboken6/ApiExtractor/docparser.cpp b/sources/shiboken6/ApiExtractor/docparser.cpp
index d50a823fa..8e5849ff5 100644
--- a/sources/shiboken6/ApiExtractor/docparser.cpp
+++ b/sources/shiboken6/ApiExtractor/docparser.cpp
@@ -58,13 +58,13 @@ DocParser::DocParser()
DocParser::~DocParser() = default;
QString DocParser::getDocumentation(const XQueryPtr &xquery, const QString& query,
- const DocModificationList& mods) const
+ const DocModificationList& mods)
{
QString doc = execXQuery(xquery, query);
return applyDocModifications(mods, doc.trimmed());
}
-QString DocParser::execXQuery(const XQueryPtr &xquery, const QString& query) const
+QString DocParser::execXQuery(const XQueryPtr &xquery, const QString& query)
{
QString errorMessage;
const QString result = xquery->evaluate(query, &errorMessage);
@@ -109,7 +109,7 @@ static inline bool isXpathDocModification(const DocModification &mod)
return mod.mode() == TypeSystem::DocModificationXPathReplace;
}
-QString DocParser::applyDocModifications(const DocModificationList& mods, const QString& xml) const
+QString DocParser::applyDocModifications(const DocModificationList& mods, const QString& xml)
{
const char xslPrefix[] =
R"(<xsl:template match="/">
diff --git a/sources/shiboken6/ApiExtractor/docparser.h b/sources/shiboken6/ApiExtractor/docparser.h
index 37c914b43..206370bca 100644
--- a/sources/shiboken6/ApiExtractor/docparser.h
+++ b/sources/shiboken6/ApiExtractor/docparser.h
@@ -115,9 +115,9 @@ public:
static bool skipForQuery(const AbstractMetaFunctionCPtr &func);
protected:
- QString getDocumentation(const XQueryPtr &xquery, const QString& query,
- const DocModificationList& mods) const;
-
+ static QString getDocumentation(const XQueryPtr &xquery,
+ const QString &query,
+ const DocModificationList &mods);
static AbstractMetaFunctionCList documentableFunctions(const AbstractMetaClass *metaClass);
@@ -126,9 +126,8 @@ private:
QString m_docDataDir;
QString m_libSourceDir;
- QString execXQuery(const XQueryPtr &xquery, const QString& query) const;
- QString applyDocModifications(const DocModificationList& mods, const QString& xml) const;
+ static QString execXQuery(const XQueryPtr &xquery, const QString &query) ;
+ static QString applyDocModifications(const DocModificationList &mods, const QString &xml) ;
};
#endif // DOCPARSER_H
-
diff --git a/sources/shiboken6/ApiExtractor/parser/codemodel.cpp b/sources/shiboken6/ApiExtractor/parser/codemodel.cpp
index 0d99df6bd..2621838fe 100644
--- a/sources/shiboken6/ApiExtractor/parser/codemodel.cpp
+++ b/sources/shiboken6/ApiExtractor/parser/codemodel.cpp
@@ -109,7 +109,7 @@ static CodeModelItem findRecursion(const ScopeModelItem &scope,
return CodeModelItem();
}
-CodeModelItem CodeModel::findItem(const QStringList &qualifiedName, const ScopeModelItem &scope) const
+CodeModelItem CodeModel::findItem(const QStringList &qualifiedName, const ScopeModelItem &scope)
{
return findRecursion(scope, qualifiedName);
}
diff --git a/sources/shiboken6/ApiExtractor/parser/codemodel.h b/sources/shiboken6/ApiExtractor/parser/codemodel.h
index cb15e5985..db61a65e7 100644
--- a/sources/shiboken6/ApiExtractor/parser/codemodel.h
+++ b/sources/shiboken6/ApiExtractor/parser/codemodel.h
@@ -105,7 +105,8 @@ public:
void addFile(const FileModelItem &item);
FileModelItem findFile(const QString &name) const;
- CodeModelItem findItem(const QStringList &qualifiedName, const ScopeModelItem &scope) const;
+ static CodeModelItem findItem(const QStringList &qualifiedName,
+ const ScopeModelItem &scope);
private:
FileList m_files;
diff --git a/sources/shiboken6/ApiExtractor/qtdocparser.h b/sources/shiboken6/ApiExtractor/qtdocparser.h
index ee6542ca3..4cc335282 100644
--- a/sources/shiboken6/ApiExtractor/qtdocparser.h
+++ b/sources/shiboken6/ApiExtractor/qtdocparser.h
@@ -40,13 +40,13 @@ public:
Documentation retrieveModuleDocumentation(const QString& name) override;
private:
- QString queryFunctionDocumentation(const QString &sourceFileName,
- const AbstractMetaClass* metaClass,
- const QString &classQuery,
- const AbstractMetaFunctionCPtr &func,
- const DocModificationList &signedModifs,
- const XQueryPtr &xquery,
- QString *errorMessage);
+ static QString queryFunctionDocumentation(const QString &sourceFileName,
+ const AbstractMetaClass* metaClass,
+ const QString &classQuery,
+ const AbstractMetaFunctionCPtr &func,
+ const DocModificationList &signedModifs,
+ const XQueryPtr &xquery,
+ QString *errorMessage);
};
#endif // QTDOCPARSER_H
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.h b/sources/shiboken6/ApiExtractor/typesystemparser.h
index 8bef9482e..efb7e2d8f 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.h
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.h
@@ -235,7 +235,7 @@ private:
QXmlStreamAttributes *);
bool parseReplaceDefaultExpression(const QXmlStreamReader &,
const StackElement &topElement, QXmlStreamAttributes *);
- CustomFunction *
+ static CustomFunction *
parseCustomMetaConstructor(const QXmlStreamReader &,
StackElement::ElementType type,
const StackElement &topElement, QXmlStreamAttributes *);
diff --git a/sources/shiboken6/generator/generator.cpp b/sources/shiboken6/generator/generator.cpp
index 332cfcff2..03eec49ed 100644
--- a/sources/shiboken6/generator/generator.cpp
+++ b/sources/shiboken6/generator/generator.cpp
@@ -426,7 +426,7 @@ bool Generator::generateFileForContext(const GeneratorContext &context)
}
QString Generator::getFileNameBaseForSmartPointer(const AbstractMetaType &smartPointerType,
- const AbstractMetaClass *smartPointerClass) const
+ const AbstractMetaClass *smartPointerClass)
{
const AbstractMetaType innerType = smartPointerType.getSmartPointerInnerType();
QString fileName = smartPointerClass->qualifiedCppName().toLower();
@@ -445,7 +445,7 @@ GeneratorContext Generator::contextForClass(const AbstractMetaClass *c) const
}
GeneratorContext Generator::contextForSmartPointer(const AbstractMetaClass *c,
- const AbstractMetaType &t) const
+ const AbstractMetaType &t)
{
GeneratorContext result;
result.m_metaClass = c;
@@ -477,7 +477,7 @@ bool Generator::generate()
return finishGeneration();
}
-bool Generator::shouldGenerateTypeEntry(const TypeEntry *type) const
+bool Generator::shouldGenerateTypeEntry(const TypeEntry *type)
{
return type->generateCode() && NamespaceTypeEntry::isVisibleScope(type);
}
diff --git a/sources/shiboken6/generator/generator.h b/sources/shiboken6/generator/generator.h
index 61b78b98d..f837896e0 100644
--- a/sources/shiboken6/generator/generator.h
+++ b/sources/shiboken6/generator/generator.h
@@ -263,18 +263,18 @@ protected:
static ContainerTypeEntryList containerTypes();
virtual GeneratorContext contextForClass(const AbstractMetaClass *c) const;
- GeneratorContext contextForSmartPointer(const AbstractMetaClass *c,
- const AbstractMetaType &t) const;
+ static GeneratorContext contextForSmartPointer(const AbstractMetaClass *c,
+ const AbstractMetaType &t);
/// Generates a file for given AbstractMetaClass or AbstractMetaType (smart pointer case).
bool generateFileForContext(const GeneratorContext &context);
/// Returns the file base name for a smart pointer.
- QString getFileNameBaseForSmartPointer(const AbstractMetaType &smartPointerType,
- const AbstractMetaClass *smartPointerClass) const;
+ static QString getFileNameBaseForSmartPointer(const AbstractMetaType &smartPointerType,
+ const AbstractMetaClass *smartPointer);
/// Returns true if the generator should generate any code for the TypeEntry.
- bool shouldGenerateTypeEntry(const TypeEntry *) const;
+ static bool shouldGenerateTypeEntry(const TypeEntry *) ;
/// Returns true if the generator should generate any code for the AbstractMetaClass.
virtual bool shouldGenerate(const AbstractMetaClass *) const;
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
index 66c267852..19501d06c 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
@@ -996,7 +996,7 @@ static QString fixLinkText(const QtXmlToSphinx::LinkContext *linkContext,
return linktext;
}
-void QtXmlToSphinx::handleLinkText(LinkContext *linkContext, const QString &linktext) const
+void QtXmlToSphinx::handleLinkText(LinkContext *linkContext, const QString &linktext)
{
linkContext->linkText = fixLinkText(linkContext, linktext);
}
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.h b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.h
index 6fb626e2b..5c3a90be5 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.h
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.h
@@ -163,7 +163,7 @@ private:
void handleRstPassTroughTag(QXmlStreamReader& reader);
LinkContext *handleLinkStart(const QString &type, QString ref) const;
- void handleLinkText(LinkContext *linkContext, const QString &linktext) const;
+ static void handleLinkText(LinkContext *linkContext, const QString &linktext) ;
void handleLinkEnd(LinkContext *linkContext);
void warn(const QString &message) const;
@@ -190,7 +190,7 @@ private:
QString readFromLocations(const QStringList &locations, const QString &path,
const QString &identifier, QString *errorMessage);
- QString readFromLocation(const QString &location, const QString &identifier,
+ static QString readFromLocation(const QString &location, const QString &identifier,
QString *errorMessage);
void pushOutputBuffer();
QString popOutputBuffer();
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 3b51f7c0d..474ba1943 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -2085,7 +2085,7 @@ void CppGenerator::writeMethodWrapper(TextStream &s, const AbstractMetaFunctionC
s<< outdent << "}\n\n";
}
-void CppGenerator::writeArgumentsInitializer(TextStream &s, OverloadData &overloadData) const
+void CppGenerator::writeArgumentsInitializer(TextStream &s, OverloadData &overloadData)
{
const auto rfunc = overloadData.referenceFunction();
s << "PyTuple_GET_SIZE(args);\n";
@@ -2183,7 +2183,7 @@ void CppGenerator::writeArgumentsInitializer(TextStream &s, OverloadData &overlo
}
void CppGenerator::writeCppSelfConversion(TextStream &s, const GeneratorContext &context,
- const QString &className, bool useWrapperClass) const
+ const QString &className, bool useWrapperClass)
{
static const QString pythonSelfVar = QLatin1String("self");
if (useWrapperClass)
@@ -2269,7 +2269,7 @@ void CppGenerator::writeCppSelfDefinition(TextStream &s,
writeCppSelfDefinition(s, context, hasStaticOverload);
}
-void CppGenerator::writeErrorSection(TextStream &s, OverloadData &overloadData) const
+void CppGenerator::writeErrorSection(TextStream &s, OverloadData &overloadData)
{
const auto rfunc = overloadData.referenceFunction();
s << '\n' << cpythonFunctionName(rfunc) << "_TypeError:\n";
@@ -4084,7 +4084,7 @@ QString CppGenerator::multipleInheritanceInitializerFunctionName(const AbstractM
return cpythonBaseName(metaClass->typeEntry()) + QLatin1String("_mi_init");
}
-bool CppGenerator::supportsMappingProtocol(const AbstractMetaClass *metaClass) const
+bool CppGenerator::supportsMappingProtocol(const AbstractMetaClass *metaClass)
{
for (const auto &m : mappingProtocols()) {
if (metaClass->hasFunction(m.name))
@@ -4102,7 +4102,7 @@ bool CppGenerator::supportsNumberProtocol(const AbstractMetaClass *metaClass) co
|| hasBoolCast(metaClass);
}
-bool CppGenerator::supportsSequenceProtocol(const AbstractMetaClass *metaClass) const
+bool CppGenerator::supportsSequenceProtocol(const AbstractMetaClass *metaClass)
{
for (const auto &seq : sequenceProtocols()) {
if (metaClass->hasFunction(seq.name))
@@ -4380,7 +4380,8 @@ static const QHash<QString, QString> &sqFuncs()
return result;
}
-void CppGenerator::writeTypeAsSequenceDefinition(TextStream &s, const AbstractMetaClass *metaClass) const
+void CppGenerator::writeTypeAsSequenceDefinition(TextStream &s,
+ const AbstractMetaClass *metaClass)
{
bool hasFunctions = false;
QMap<QString, QString> funcs;
@@ -4411,7 +4412,8 @@ void CppGenerator::writeTypeAsSequenceDefinition(TextStream &s, const AbstractMe
}
}
-void CppGenerator::writeTypeAsMappingDefinition(TextStream &s, const AbstractMetaClass *metaClass) const
+void CppGenerator::writeTypeAsMappingDefinition(TextStream &s,
+ const AbstractMetaClass *metaClass)
{
// Sequence protocol structure members names
static const QHash<QString, QString> mpFuncs{
@@ -5164,7 +5166,7 @@ void CppGenerator::writeSignalInitialization(TextStream &s, const AbstractMetaCl
<< metaClass->qualifiedCppName() << "::staticMetaObject);\n";
}
-void CppGenerator::writeFlagsToLong(TextStream &s, const AbstractMetaEnum &cppEnum) const
+void CppGenerator::writeFlagsToLong(TextStream &s, const AbstractMetaEnum &cppEnum)
{
FlagsTypeEntry *flagsEntry = cppEnum.typeEntry()->flags();
if (!flagsEntry)
@@ -5178,7 +5180,7 @@ void CppGenerator::writeFlagsToLong(TextStream &s, const AbstractMetaEnum &cppEn
<< outdent << "}\n";
}
-void CppGenerator::writeFlagsNonZero(TextStream &s, const AbstractMetaEnum &cppEnum) const
+void CppGenerator::writeFlagsNonZero(TextStream &s, const AbstractMetaEnum &cppEnum)
{
FlagsTypeEntry *flagsEntry = cppEnum.typeEntry()->flags();
if (!flagsEntry)
@@ -5191,7 +5193,7 @@ void CppGenerator::writeFlagsNonZero(TextStream &s, const AbstractMetaEnum &cppE
<< outdent << "}\n";
}
-void CppGenerator::writeFlagsMethods(TextStream &s, const AbstractMetaEnum &cppEnum) const
+void CppGenerator::writeFlagsMethods(TextStream &s, const AbstractMetaEnum &cppEnum)
{
writeFlagsBinaryOperator(s, cppEnum, QLatin1String("and"), QLatin1String("&"));
writeFlagsBinaryOperator(s, cppEnum, QLatin1String("or"), QLatin1String("|"));
@@ -5220,7 +5222,8 @@ void CppGenerator::writeFlagsNumberMethodsDefinition(TextStream &s, const Abstra
<< "};\n\n";
}
-void CppGenerator::writeFlagsNumberMethodsDefinitions(TextStream &s, const AbstractMetaEnumList &enums) const
+void CppGenerator::writeFlagsNumberMethodsDefinitions(TextStream &s,
+ const AbstractMetaEnumList &enums)
{
for (const AbstractMetaEnum &e : enums) {
if (!e.isAnonymous() && !e.isPrivate() && e.typeEntry()->flags()) {
@@ -5232,7 +5235,7 @@ void CppGenerator::writeFlagsNumberMethodsDefinitions(TextStream &s, const Abstr
}
void CppGenerator::writeFlagsBinaryOperator(TextStream &s, const AbstractMetaEnum &cppEnum,
- const QString &pyOpName, const QString &cppOpName) const
+ const QString &pyOpName, const QString &cppOpName)
{
FlagsTypeEntry *flagsEntry = cppEnum.typeEntry()->flags();
Q_ASSERT(flagsEntry);
@@ -5257,7 +5260,7 @@ void CppGenerator::writeFlagsBinaryOperator(TextStream &s, const AbstractMetaEnu
void CppGenerator::writeFlagsUnaryOperator(TextStream &s, const AbstractMetaEnum &cppEnum,
const QString &pyOpName,
- const QString &cppOpName, bool boolResult) const
+ const QString &cppOpName, bool boolResult)
{
FlagsTypeEntry *flagsEntry = cppEnum.typeEntry()->flags();
Q_ASSERT(flagsEntry);
@@ -5282,7 +5285,7 @@ void CppGenerator::writeFlagsUnaryOperator(TextStream &s, const AbstractMetaEnum
s << ";\n" << outdent << "}\n\n";
}
-QString CppGenerator::getSimpleClassInitFunctionName(const AbstractMetaClass *metaClass) const
+QString CppGenerator::getSimpleClassInitFunctionName(const AbstractMetaClass *metaClass)
{
QString initFunctionName;
// Disambiguate namespaces per module to allow for extending them.
@@ -5293,7 +5296,7 @@ QString CppGenerator::getSimpleClassInitFunctionName(const AbstractMetaClass *me
return initFunctionName;
}
-QString CppGenerator::getInitFunctionName(const GeneratorContext &context) const
+QString CppGenerator::getInitFunctionName(const GeneratorContext &context)
{
return !context.forSmartPointer()
? getSimpleClassInitFunctionName(context.metaClass())
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.h b/sources/shiboken6/generator/shiboken/cppgenerator.h
index 743dee124..45313e5be 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.h
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.h
@@ -96,9 +96,11 @@ private:
const GeneratorContext &classContext) const;
void writeMethodWrapper(TextStream &s, const AbstractMetaFunctionCList &overloads,
const GeneratorContext &classContext) const;
- void writeArgumentsInitializer(TextStream &s, OverloadData &overloadData) const;
- void writeCppSelfConversion(TextStream &s, const GeneratorContext &context,
- const QString &className, bool useWrapperClass) const;
+ static void writeArgumentsInitializer(TextStream &s, OverloadData &overloadData) ;
+ static void writeCppSelfConversion(TextStream &s,
+ const GeneratorContext &context,
+ const QString &className,
+ bool useWrapperClass);
void writeCppSelfDefinition(TextStream &s,
const AbstractMetaFunctionCPtr &func,
const GeneratorContext &context,
@@ -108,7 +110,7 @@ private:
bool hasStaticOverload = false,
bool cppSelfAsReference = false) const;
- void writeErrorSection(TextStream &s, OverloadData &overloadData) const;
+ static void writeErrorSection(TextStream &s, OverloadData &overloadData) ;
static void writeFunctionReturnErrorCheckSection(TextStream &s, bool hasReturnValue = true);
/// Writes the check section for the validity of wrapped C++ objects.
@@ -276,8 +278,8 @@ private:
void writeMethodCall(TextStream &s, const AbstractMetaFunctionCPtr &func,
const GeneratorContext &context, int maxArgs = 0) const;
- QString getInitFunctionName(const GeneratorContext &context) const;
- QString getSimpleClassInitFunctionName(const AbstractMetaClass *metaClass) const;
+ static QString getInitFunctionName(const GeneratorContext &context) ;
+ static QString getSimpleClassInitFunctionName(const AbstractMetaClass *metaClass) ;
static void writeSignatureStrings(TextStream &s, const QString &signatures,
const QString &arrayName,
@@ -299,10 +301,12 @@ private:
void writeSequenceMethods(TextStream &s,
const AbstractMetaClass *metaClass,
const GeneratorContext &context) const;
- void writeTypeAsSequenceDefinition(TextStream &s, const AbstractMetaClass *metaClass) const;
+ static void writeTypeAsSequenceDefinition(TextStream &s,
+ const AbstractMetaClass *metaClass);
/// Writes the PyMappingMethods structure for types that supports the python mapping protocol.
- void writeTypeAsMappingDefinition(TextStream &s, const AbstractMetaClass *metaClass) const;
+ static void writeTypeAsMappingDefinition(TextStream &s,
+ const AbstractMetaClass *metaClass);
void writeMappingMethods(TextStream &s,
const AbstractMetaClass *metaClass,
const GeneratorContext &context) const;
@@ -339,16 +343,21 @@ private:
static void writeSignalInitialization(TextStream &s, const AbstractMetaClass *metaClass);
- void writeFlagsMethods(TextStream &s, const AbstractMetaEnum &cppEnum) const;
- void writeFlagsToLong(TextStream &s, const AbstractMetaEnum &cppEnum) const;
- void writeFlagsNonZero(TextStream &s, const AbstractMetaEnum &cppEnum) const;
+ static void writeFlagsMethods(TextStream &s, const AbstractMetaEnum &cppEnum);
+ static void writeFlagsToLong(TextStream &s, const AbstractMetaEnum &cppEnum);
+ static void writeFlagsNonZero(TextStream &s, const AbstractMetaEnum &cppEnum);
static void writeFlagsNumberMethodsDefinition(TextStream &s, const AbstractMetaEnum &cppEnum);
- void writeFlagsNumberMethodsDefinitions(TextStream &s, const AbstractMetaEnumList &enums) const;
- void writeFlagsBinaryOperator(TextStream &s, const AbstractMetaEnum &cppEnum,
- const QString &pyOpName, const QString &cppOpName) const;
- void writeFlagsUnaryOperator(TextStream &s, const AbstractMetaEnum &cppEnum,
- const QString &pyOpName, const QString &cppOpName,
- bool boolResult = false) const;
+ static void writeFlagsNumberMethodsDefinitions(TextStream &s,
+ const AbstractMetaEnumList &enums);
+ static void writeFlagsBinaryOperator(TextStream &s,
+ const AbstractMetaEnum &cppEnum,
+ const QString &pyOpName,
+ const QString &cppOpName);
+ static void writeFlagsUnaryOperator(TextStream &s,
+ const AbstractMetaEnum &cppEnum,
+ const QString &pyOpName,
+ const QString &cppOpName,
+ bool boolResult = false);
/// Writes the function that registers the multiple inheritance information for the classes that need it.
static void writeMultipleInheritanceInitializerFunction(TextStream &s, const AbstractMetaClass *metaClass);
@@ -386,10 +395,10 @@ private:
bool supportsNumberProtocol(const AbstractMetaClass *metaClass) const;
/// Returns true if the given class supports the python sequence protocol
- bool supportsSequenceProtocol(const AbstractMetaClass *metaClass) const;
+ static bool supportsSequenceProtocol(const AbstractMetaClass *metaClass) ;
/// Returns true if the given class supports the python mapping protocol
- bool supportsMappingProtocol(const AbstractMetaClass *metaClass) const;
+ static bool supportsMappingProtocol(const AbstractMetaClass *metaClass) ;
/// Returns true if generator should produce getters and setters for the given class.
bool shouldGenerateGetSetList(const AbstractMetaClass *metaClass) const;
diff --git a/sources/shiboken6/generator/shiboken/headergenerator.cpp b/sources/shiboken6/generator/shiboken/headergenerator.cpp
index 005543d84..967e939ba 100644
--- a/sources/shiboken6/generator/shiboken/headergenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/headergenerator.cpp
@@ -608,13 +608,13 @@ void HeaderGenerator::writeSbkTypeFunction(TextStream &s, const AbstractMetaEnum
}
}
-void HeaderGenerator::writeSbkTypeFunction(TextStream &s, const AbstractMetaClass *cppClass) const
+void HeaderGenerator::writeSbkTypeFunction(TextStream &s, const AbstractMetaClass *cppClass)
{
s << "template<> inline PyTypeObject *SbkType< ::" << cppClass->qualifiedCppName() << " >() "
<< "{ return reinterpret_cast<PyTypeObject *>(" << cpythonTypeNameExt(cppClass->typeEntry()) << "); }\n";
}
-void HeaderGenerator::writeSbkTypeFunction(TextStream &s, const AbstractMetaType &metaType) const
+void HeaderGenerator::writeSbkTypeFunction(TextStream &s, const AbstractMetaType &metaType)
{
s << "template<> inline PyTypeObject *SbkType< ::" << metaType.cppSignature() << " >() "
<< "{ return reinterpret_cast<PyTypeObject *>(" << cpythonTypeNameExt(metaType) << "); }\n";
diff --git a/sources/shiboken6/generator/shiboken/headergenerator.h b/sources/shiboken6/generator/shiboken/headergenerator.h
index e97c16b85..f95176290 100644
--- a/sources/shiboken6/generator/shiboken/headergenerator.h
+++ b/sources/shiboken6/generator/shiboken/headergenerator.h
@@ -57,8 +57,8 @@ private:
const AbstractMetaField &field);
void writeFunction(TextStream &s, const AbstractMetaFunctionCPtr &func);
void writeSbkTypeFunction(TextStream &s, const AbstractMetaEnum &cppEnum) const;
- void writeSbkTypeFunction(TextStream &s, const AbstractMetaClass *cppClass) const;
- void writeSbkTypeFunction(TextStream &s, const AbstractMetaType &metaType) const;
+ static void writeSbkTypeFunction(TextStream &s, const AbstractMetaClass *cppClass) ;
+ static void writeSbkTypeFunction(TextStream &s, const AbstractMetaType &metaType) ;
static void writeTypeIndexValueLine(TextStream &s, const ApiExtractorResult &api,
const TypeEntry *typeEntry);
static void writeTypeIndexValueLines(TextStream &s, const ApiExtractorResult &api,
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
index 8130570e6..7e8f64932 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
@@ -327,7 +327,7 @@ QString ShibokenGenerator::protectedFieldSetterName(const AbstractMetaField &fie
return QLatin1String("protected_") + field.name() + QLatin1String("_setter");
}
-QString ShibokenGenerator::cpythonFunctionName(const AbstractMetaFunctionCPtr &func) const
+QString ShibokenGenerator::cpythonFunctionName(const AbstractMetaFunctionCPtr &func)
{
QString result;
@@ -600,7 +600,7 @@ QString ShibokenGenerator::cpythonWrapperCPtr(const AbstractMetaClass *metaClass
}
QString ShibokenGenerator::cpythonWrapperCPtr(const AbstractMetaType &metaType,
- const QString &argName) const
+ const QString &argName)
{
if (!metaType.isWrapperType())
return QString();
@@ -621,20 +621,20 @@ QString ShibokenGenerator::cpythonWrapperCPtr(const TypeEntry *type,
void ShibokenGenerator::writeToPythonConversion(TextStream & s, const AbstractMetaType &type,
const AbstractMetaClass * /* context */,
- const QString &argumentName) const
+ const QString &argumentName)
{
s << cpythonToPythonConversionFunction(type) << argumentName << ')';
}
void ShibokenGenerator::writeToCppConversion(TextStream &s, const AbstractMetaClass *metaClass,
- const QString &inArgName, const QString &outArgName) const
+ const QString &inArgName, const QString &outArgName)
{
s << cpythonToCppConversionFunction(metaClass) << inArgName << ", &" << outArgName << ')';
}
void ShibokenGenerator::writeToCppConversion(TextStream &s, const AbstractMetaType &type,
const AbstractMetaClass *context, const QString &inArgName,
- const QString &outArgName) const
+ const QString &outArgName)
{
s << cpythonToCppConversionFunction(type, context) << inArgName << ", &" << outArgName << ')';
}
@@ -788,7 +788,7 @@ QString ShibokenGenerator::cpythonTypeNameExt(const TypeEntry *type)
+ getTypeIndexVariableName(type) + QLatin1Char(']');
}
-QString ShibokenGenerator::converterObject(const AbstractMetaType &type) const
+QString ShibokenGenerator::converterObject(const AbstractMetaType &type)
{
if (type.isCString())
return QLatin1String("Shiboken::Conversions::PrimitiveTypeConverter<const char *>()");
@@ -837,7 +837,7 @@ QString ShibokenGenerator::converterObject(const TypeEntry *type)
+ QLatin1Char('[') + getTypeIndexVariableName(type) + QLatin1Char(']');
}
-QString ShibokenGenerator::cpythonTypeNameExt(const AbstractMetaType &type) const
+QString ShibokenGenerator::cpythonTypeNameExt(const AbstractMetaType &type)
{
return cppApiVariableName(type.typeEntry()->targetLangPackage()) + QLatin1Char('[')
+ getTypeIndexVariableName(type) + QLatin1Char(']');
@@ -1210,14 +1210,14 @@ QString ShibokenGenerator::cpythonIsConvertibleFunction(const AbstractMetaArgume
return cpythonIsConvertibleFunction(metaArg.type(), genericNumberType);
}
-QString ShibokenGenerator::cpythonToCppConversionFunction(const AbstractMetaClass *metaClass) const
+QString ShibokenGenerator::cpythonToCppConversionFunction(const AbstractMetaClass *metaClass)
{
return QLatin1String("Shiboken::Conversions::pythonToCppPointer(reinterpret_cast<SbkObjectType *>(")
+ cpythonTypeNameExt(metaClass->typeEntry()) + QLatin1String("), ");
}
QString ShibokenGenerator::cpythonToCppConversionFunction(const AbstractMetaType &type,
- const AbstractMetaClass * /* context */) const
+ const AbstractMetaClass * /* context */)
{
if (type.isWrapperType()) {
return QLatin1String("Shiboken::Conversions::pythonToCpp")
@@ -1230,7 +1230,7 @@ QString ShibokenGenerator::cpythonToCppConversionFunction(const AbstractMetaType
}
QString ShibokenGenerator::cpythonToPythonConversionFunction(const AbstractMetaType &type,
- const AbstractMetaClass * /* context */) const
+ const AbstractMetaClass * /* context */)
{
if (type.isWrapperType()) {
QString conversion;
@@ -1254,12 +1254,12 @@ QString ShibokenGenerator::cpythonToPythonConversionFunction(const AbstractMetaT
(type.isCString() || type.isVoidPointer()) ? QString() : QLatin1String("&"));
}
-QString ShibokenGenerator::cpythonToPythonConversionFunction(const AbstractMetaClass *metaClass) const
+QString ShibokenGenerator::cpythonToPythonConversionFunction(const AbstractMetaClass *metaClass)
{
return cpythonToPythonConversionFunction(metaClass->typeEntry());
}
-QString ShibokenGenerator::cpythonToPythonConversionFunction(const TypeEntry *type) const
+QString ShibokenGenerator::cpythonToPythonConversionFunction(const TypeEntry *type)
{
if (type->isWrapperType()) {
const QString conversion = type->isValue() ? QLatin1String("copy") : QLatin1String("pointer");
@@ -1397,7 +1397,7 @@ QString ShibokenGenerator::functionSignature(const AbstractMetaFunctionCPtr &fun
void ShibokenGenerator::writeArgumentNames(TextStream &s,
const AbstractMetaFunctionCPtr &func,
- Options options) const
+ Options options)
{
const AbstractMetaArgumentList arguments = func->arguments();
int argCount = 0;
@@ -1421,7 +1421,7 @@ void ShibokenGenerator::writeArgumentNames(TextStream &s,
void ShibokenGenerator::writeFunctionCall(TextStream &s,
const AbstractMetaFunctionCPtr &func,
- Options options) const
+ Options options)
{
if (!(options & Generator::SkipName))
s << (func->isConstructor() ? func->ownerClass()->qualifiedCppName() : func->originalName());
@@ -1488,7 +1488,7 @@ ShibokenGenerator::ExtendedConverterData ShibokenGenerator::getExtendedConverter
return extConvs;
}
-QList<const CustomConversion *> ShibokenGenerator::getPrimitiveCustomConversions() const
+QList<const CustomConversion *> ShibokenGenerator::getPrimitiveCustomConversions()
{
QList<const CustomConversion *> conversions;
const PrimitiveTypeEntryList &primitiveTypeList = primitiveTypes();
@@ -2118,7 +2118,8 @@ bool ShibokenGenerator::classNeedsGetattroFunctionImpl(const AbstractMetaClass *
return false;
}
-AbstractMetaFunctionCList ShibokenGenerator::getMethodsWithBothStaticAndNonStaticMethods(const AbstractMetaClass *metaClass) const
+AbstractMetaFunctionCList
+ ShibokenGenerator::getMethodsWithBothStaticAndNonStaticMethods(const AbstractMetaClass *metaClass)
{
AbstractMetaFunctionCList methods;
if (metaClass) {
@@ -2151,7 +2152,7 @@ const AbstractMetaClass *ShibokenGenerator::getMultipleInheritingClass(const Abs
return getMultipleInheritingClass(metaClass->baseClass());
}
-QString ShibokenGenerator::getModuleHeaderFileName(const QString &moduleName) const
+QString ShibokenGenerator::getModuleHeaderFileName(const QString &moduleName)
{
return moduleCppPrefix(moduleName).toLower() + QLatin1String("_python.h");
}
@@ -2574,7 +2575,7 @@ QString ShibokenGenerator::getTypeIndexVariableName(const TypeEntry *type)
appendIndexSuffix(&result);
return result;
}
-QString ShibokenGenerator::getTypeIndexVariableName(const AbstractMetaType &type) const
+QString ShibokenGenerator::getTypeIndexVariableName(const AbstractMetaType &type)
{
QString result = QLatin1String("SBK");
if (type.typeEntry()->isContainer())
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.h b/sources/shiboken6/generator/shiboken/shibokengenerator.h
index 64096db52..d4a3d5f84 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.h
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.h
@@ -166,18 +166,26 @@ protected:
AttroCheck checkAttroFunctionNeeds(const AbstractMetaClass *metaClass) const;
/// Returns a list of methods of the given class where each one is part of a different overload with both static and non-static method.
- AbstractMetaFunctionCList getMethodsWithBothStaticAndNonStaticMethods(const AbstractMetaClass *metaClass) const;
-
- void writeToPythonConversion(TextStream &s, const AbstractMetaType &type,
- const AbstractMetaClass *context, const QString &argumentName) const;
- void writeToCppConversion(TextStream &s, const AbstractMetaType &type, const AbstractMetaClass *context,
- const QString &inArgName, const QString &outArgName) const;
- void writeToCppConversion(TextStream &s, const AbstractMetaClass *metaClass, const QString &inArgName,
- const QString &outArgName) const;
+ static AbstractMetaFunctionCList
+ getMethodsWithBothStaticAndNonStaticMethods(const AbstractMetaClass *metaClass);
+
+ static void writeToPythonConversion(TextStream &s,
+ const AbstractMetaType &type,
+ const AbstractMetaClass *context,
+ const QString &argumentName);
+ static void writeToCppConversion(TextStream &s,
+ const AbstractMetaType &type,
+ const AbstractMetaClass *context,
+ const QString &inArgName,
+ const QString &outArgName);
+ static void writeToCppConversion(TextStream &s,
+ const AbstractMetaClass *metaClass, const QString &inArgName,
+ const QString &outArgName);
/// Returns true if the argument is a pointer that rejects nullptr values.
static bool shouldRejectNullPointerArgument(const ApiExtractorResult &api,
- const AbstractMetaFunctionCPtr &func, int argIndex);
+ const AbstractMetaFunctionCPtr &func,
+ int argIndex);
/// Verifies if the class should have a C++ wrapper generated for it, instead of only a Python wrapper.
bool shouldGenerateCppWrapper(const AbstractMetaClass *metaClass) const;
@@ -221,7 +229,7 @@ protected:
static bool isNullPtr(const QString &value);
- QString converterObject(const AbstractMetaType &type) const;
+ static QString converterObject(const AbstractMetaType &type) ;
static QString converterObject(const TypeEntry *type);
static QString cpythonBaseName(const AbstractMetaClass *metaClass);
@@ -230,7 +238,7 @@ protected:
static QString cpythonTypeName(const AbstractMetaClass *metaClass);
static QString cpythonTypeName(const TypeEntry *type);
static QString cpythonTypeNameExt(const TypeEntry *type);
- QString cpythonTypeNameExt(const AbstractMetaType &type) const;
+ static QString cpythonTypeNameExt(const AbstractMetaType &type) ;
QString cpythonCheckFunction(const TypeEntry *type, bool genericNumberType = false) const;
QString cpythonCheckFunction(AbstractMetaType metaType, bool genericNumberType = false) const;
/**
@@ -258,15 +266,15 @@ protected:
QString cpythonIsConvertibleFunction(const AbstractMetaArgument &metaArg,
bool genericNumberType = false) const;
- QString cpythonToCppConversionFunction(const AbstractMetaClass *metaClass) const;
- QString cpythonToCppConversionFunction(const AbstractMetaType &type,
- const AbstractMetaClass *context = nullptr) const;
- QString cpythonToPythonConversionFunction(const AbstractMetaType &type,
- const AbstractMetaClass *context = nullptr) const;
- QString cpythonToPythonConversionFunction(const AbstractMetaClass *metaClass) const;
- QString cpythonToPythonConversionFunction(const TypeEntry *type) const;
+ static QString cpythonToCppConversionFunction(const AbstractMetaClass *metaClass) ;
+ static QString cpythonToCppConversionFunction(const AbstractMetaType &type,
+ const AbstractMetaClass *context = nullptr);
+ static QString cpythonToPythonConversionFunction(const AbstractMetaType &type,
+ const AbstractMetaClass *context = nullptr);
+ static QString cpythonToPythonConversionFunction(const AbstractMetaClass *metaClass);
+ static QString cpythonToPythonConversionFunction(const TypeEntry *type);
- QString cpythonFunctionName(const AbstractMetaFunctionCPtr &func) const;
+ static QString cpythonFunctionName(const AbstractMetaFunctionCPtr &func) ;
static QString cpythonMethodDefinitionName(const AbstractMetaFunctionCPtr &func);
static QString cpythonGettersSettersDefinitionName(const AbstractMetaClass *metaClass);
static QString cpythonGetattroFunctionName(const AbstractMetaClass *metaClass);
@@ -278,8 +286,9 @@ protected:
static QString cpythonSetterFunctionName(const QPropertySpec &property,
const AbstractMetaClass *metaClass);
static QString cpythonWrapperCPtr(const AbstractMetaClass *metaClass,
- const QString &argName = QLatin1String("self"));
- QString cpythonWrapperCPtr(const AbstractMetaType &metaType, const QString &argName) const;
+ const QString &argName = QLatin1String("self"));
+ static QString cpythonWrapperCPtr(const AbstractMetaType &metaType,
+ const QString &argName);
static QString cpythonWrapperCPtr(const TypeEntry *type, const QString &argName);
/// Guesses the scope to where belongs an argument's default value.
@@ -300,7 +309,7 @@ protected:
static QString getFormatUnitString(const AbstractMetaFunctionCPtr &func, bool incRef = false);
/// Returns the file name for the module global header. If no module name is provided the current will be used.
- QString getModuleHeaderFileName(const QString &moduleName = QString()) const;
+ static QString getModuleHeaderFileName(const QString &moduleName = QString()) ;
OptionDescriptions options() const override;
bool handleOption(const QString &key, const QString &value) override;
@@ -325,7 +334,7 @@ protected:
static QString getTypeIndexVariableName(const AbstractMetaClass *metaClass,
bool alternativeTemplateName = false);
static QString getTypeIndexVariableName(const TypeEntry *type);
- QString getTypeIndexVariableName(const AbstractMetaType &type) const;
+ static QString getTypeIndexVariableName(const AbstractMetaType &type) ;
/// Returns true if the user don't want verbose error messages on the generated bindings.
bool verboseErrorMessagesDisabled() const;
@@ -357,9 +366,9 @@ protected:
void collectContainerTypesFromConverterMacros(const QString &code, bool toPythonMacro);
- void writeFunctionCall(TextStream &s,
- const AbstractMetaFunctionCPtr &metaFunc,
- Options options = NoOption) const;
+ static void writeFunctionCall(TextStream &s,
+ const AbstractMetaFunctionCPtr &metaFunc,
+ Options options = NoOption);
static void writeUnusedVariableCast(TextStream &s, const QString &variableName);
@@ -372,7 +381,7 @@ protected:
ExtendedConverterData getExtendedConverters() const;
/// Returns a list of converters for the non wrapper types of the current module.
- QList<const CustomConversion *> getPrimitiveCustomConversions() const;
+ static QList<const CustomConversion *> getPrimitiveCustomConversions() ;
/// Returns true if the Python wrapper for the received OverloadData must accept a list of arguments.
static bool pythonFunctionWrapperUsesListOfArguments(const OverloadData &overloadData);
@@ -490,9 +499,9 @@ private:
/// \param func the pointer to metafunction information
/// \param count the number of function arguments
/// \param options some extra options used during the parser
- void writeArgumentNames(TextStream &s,
- const AbstractMetaFunctionCPtr &func,
- Options options = NoOption) const;
+ static void writeArgumentNames(TextStream &s,
+ const AbstractMetaFunctionCPtr &func,
+ Options option);
void writeFunctionArguments(TextStream &s,
const AbstractMetaFunctionCPtr &func,