diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 08:24:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 13:42:12 +0200 |
commit | 3dd32863337ea2f6308ebf2f7656795d3fd488c9 (patch) | |
tree | 08a3b35607dee19536ccb5f21b2ede0fdc41cc79 /sources/shiboken2/generator/shiboken2/shibokengenerator.h | |
parent | 4f4f1be9f46e02e87357aeee613cfd5ea0be8220 (diff) | |
parent | 67d635fe2cc2c89c30486a2e26dea4106a9d9c16 (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/shibokengenerator.h')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.h | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.h b/sources/shiboken2/generator/shiboken2/shibokengenerator.h index f5f291526..84b3137b8 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.h +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.h @@ -74,16 +74,16 @@ public: /** * Helper function to find for argument default value */ - static QString getDefaultValue(const AbstractMetaFunction* func, const AbstractMetaArgument* arg); + static QString getDefaultValue(const AbstractMetaFunction *func, const AbstractMetaArgument *arg); /// Returns a list of all ancestor classes for the given class. - AbstractMetaClassList getAllAncestors(const AbstractMetaClass* metaClass) const; + AbstractMetaClassList getAllAncestors(const AbstractMetaClass *metaClass) const; protected: bool doSetup() override; void writeArgumentNames(QTextStream &s, - const AbstractMetaFunction* func, + const AbstractMetaFunction *func, Options options = NoOption) const override; /** @@ -94,7 +94,7 @@ protected: * \param options some extra options used during the parser */ void writeFunctionArguments(QTextStream &s, - const AbstractMetaFunction* func, + const AbstractMetaFunction *func, Options options = NoOption) const override; /** @@ -114,21 +114,21 @@ protected: AbstractMetaFunctionList getFunctionAndInheritedOverloads(const AbstractMetaFunction *func, QSet<QString> *seen); /// Write user's custom code snippets at class or module level. - void writeCodeSnips(QTextStream& s, + void writeCodeSnips(QTextStream &s, const QVector<CodeSnip> & codeSnips, TypeSystem::CodeSnipPosition position, TypeSystem::Language language, - const AbstractMetaClass* context = 0); + const AbstractMetaClass *context = nullptr); /// Write user's custom code snippets at function level. - void writeCodeSnips(QTextStream& s, + void writeCodeSnips(QTextStream &s, const QVector<CodeSnip> & codeSnips, TypeSystem::CodeSnipPosition position, TypeSystem::Language language, - const AbstractMetaFunction* func, - const AbstractMetaArgument* lastArg = 0); + const AbstractMetaFunction *func, + const AbstractMetaArgument *lastArg = nullptr); /// Replaces variables for the user's custom code at global or class level. - void processCodeSnip(QString& code, const AbstractMetaClass* context = 0); + void processCodeSnip(QString &code, const AbstractMetaClass *context = nullptr); /** * Verifies if any of the function's code injections of the "native" @@ -136,7 +136,7 @@ protected: * \param func the function to check * \return true if the function's native code snippets use "%PYSELF" */ - bool injectedCodeUsesPySelf(const AbstractMetaFunction* func); + bool injectedCodeUsesPySelf(const AbstractMetaFunction *func); /** * Verifies if any of the function's code injections makes a call @@ -145,7 +145,7 @@ protected: * \param func the function to check * \return true if the function's code snippets call the wrapped C++ function */ - bool injectedCodeCallsCppFunction(const AbstractMetaFunction* func); + bool injectedCodeCallsCppFunction(const AbstractMetaFunction *func); /** * Verifies if any of the function's code injections of the "native" class makes a @@ -154,7 +154,7 @@ protected: * \param func the function to check * \return true if the function's code snippets call the Python override for a C++ virtual method */ - bool injectedCodeCallsPythonOverride(const AbstractMetaFunction* func); + bool injectedCodeCallsPythonOverride(const AbstractMetaFunction *func); /** * Verifies if any of the function's code injections attributes values to @@ -163,13 +163,13 @@ protected: * \param language the kind of code snip * \return true if the function's code attributes values to "%0" or "%PYARG_0" */ - bool injectedCodeHasReturnValueAttribution(const AbstractMetaFunction* func, TypeSystem::Language language = TypeSystem::TargetLangCode); + bool injectedCodeHasReturnValueAttribution(const AbstractMetaFunction *func, TypeSystem::Language language = TypeSystem::TargetLangCode); /** * Verifies if any of the function's code injections uses the type system variable * for function arguments of a given index. */ - bool injectedCodeUsesArgument(const AbstractMetaFunction* func, int argumentIndex); + bool injectedCodeUsesArgument(const AbstractMetaFunction *func, int argumentIndex); /** * Function which parse the metafunction information @@ -177,125 +177,125 @@ protected: * \param option some extra options * \param arg_count the number of function arguments */ - QString functionSignature(const AbstractMetaFunction* func, + QString functionSignature(const AbstractMetaFunction *func, const QString &prepend = QString(), const QString &append = QString(), Options options = NoOption, int arg_count = -1) const; /// Returns the top-most class that has multiple inheritance in the ancestry. - static const AbstractMetaClass *getMultipleInheritingClass(const AbstractMetaClass* metaClass); + static const AbstractMetaClass *getMultipleInheritingClass(const AbstractMetaClass *metaClass); /// Returns true if the class needs to have a getattro function. - bool classNeedsGetattroFunction(const AbstractMetaClass* metaClass); + bool classNeedsGetattroFunction(const AbstractMetaClass *metaClass); /// Returns true if the class needs to have a setattro function. bool classNeedsSetattroFunction(const AbstractMetaClass *metaClass); /// 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. - AbstractMetaFunctionList getMethodsWithBothStaticAndNonStaticMethods(const AbstractMetaClass* metaClass); + AbstractMetaFunctionList getMethodsWithBothStaticAndNonStaticMethods(const AbstractMetaClass *metaClass); /// Returns a list of parent classes for a given class. - AbstractMetaClassList getBaseClasses(const AbstractMetaClass* metaClass) const; + AbstractMetaClassList getBaseClasses(const AbstractMetaClass *metaClass) const; - void writeToPythonConversion(QTextStream& s, const AbstractMetaType* type, - const AbstractMetaClass* context, const QString& argumentName); - void writeToCppConversion(QTextStream& s, const AbstractMetaType* type, const AbstractMetaClass* context, const QString& inArgName, const QString& outArgName); - void writeToCppConversion(QTextStream& s, const AbstractMetaClass* metaClass, const QString& inArgName, const QString& outArgName); + void writeToPythonConversion(QTextStream &s, const AbstractMetaType *type, + const AbstractMetaClass *context, const QString &argumentName); + void writeToCppConversion(QTextStream &s, const AbstractMetaType *type, const AbstractMetaClass *context, const QString &inArgName, const QString &outArgName); + void writeToCppConversion(QTextStream &s, const AbstractMetaClass *metaClass, const QString &inArgName, const QString &outArgName); /// Returns true if the argument is a pointer that rejects nullptr values. - bool shouldRejectNullPointerArgument(const AbstractMetaFunction* func, int argIndex); + bool shouldRejectNullPointerArgument(const AbstractMetaFunction *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; + bool shouldGenerateCppWrapper(const AbstractMetaClass *metaClass) const; /// Adds enums eligible for generation from classes/namespaces marked not to be generated. - static void lookForEnumsInClassesNotToBeGenerated(AbstractMetaEnumList& enumList, const AbstractMetaClass* metaClass); + static void lookForEnumsInClassesNotToBeGenerated(AbstractMetaEnumList &enumList, const AbstractMetaClass *metaClass); /// Returns the enclosing class for an enum, or nullptr if it should be global. - const AbstractMetaClass* getProperEnclosingClassForEnum(const AbstractMetaEnum* metaEnum); + const AbstractMetaClass *getProperEnclosingClassForEnum(const AbstractMetaEnum *metaEnum); - QString wrapperName(const AbstractMetaClass* metaClass) const; + QString wrapperName(const AbstractMetaClass *metaClass) const; QString wrapperName(const AbstractMetaType *metaType) const; QString fullPythonClassName(const AbstractMetaClass *metaClass); QString fullPythonFunctionName(const AbstractMetaFunction *func); - static QString protectedEnumSurrogateName(const AbstractMetaEnum* metaEnum); - static QString protectedFieldGetterName(const AbstractMetaField* field); - static QString protectedFieldSetterName(const AbstractMetaField* field); + static QString protectedEnumSurrogateName(const AbstractMetaEnum *metaEnum); + static QString protectedFieldGetterName(const AbstractMetaField *field); + static QString protectedFieldSetterName(const AbstractMetaField *field); - static QString pythonPrimitiveTypeName(const QString& cppTypeName); - static QString pythonPrimitiveTypeName(const PrimitiveTypeEntry* type); + static QString pythonPrimitiveTypeName(const QString &cppTypeName); + static QString pythonPrimitiveTypeName(const PrimitiveTypeEntry *type); static QString pythonOperatorFunctionName(const QString &cppOpFuncName); - static QString pythonOperatorFunctionName(const AbstractMetaFunction* func); + static QString pythonOperatorFunctionName(const AbstractMetaFunction *func); static QString pythonRichCompareOperatorId(const QString &cppOpFuncName); - static QString pythonRichCompareOperatorId(const AbstractMetaFunction* func); + static QString pythonRichCompareOperatorId(const AbstractMetaFunction *func); - static QString fixedCppTypeName(const CustomConversion::TargetToNativeConversion* toNative); - static QString fixedCppTypeName(const AbstractMetaType* type); - static QString fixedCppTypeName(const TypeEntry* type, QString typeName = QString()); + static QString fixedCppTypeName(const CustomConversion::TargetToNativeConversion *toNative); + static QString fixedCppTypeName(const AbstractMetaType *type); + static QString fixedCppTypeName(const TypeEntry *type, QString typeName = QString()); static bool isNumber(const QString &cpythonApiName); - static bool isNumber(const TypeEntry* type); - static bool isNumber(const AbstractMetaType* type); - static bool isPyInt(const TypeEntry* type); - static bool isPyInt(const AbstractMetaType* type); + static bool isNumber(const TypeEntry *type); + static bool isNumber(const AbstractMetaType *type); + static bool isPyInt(const TypeEntry *type); + static bool isPyInt(const AbstractMetaType *type); /** * Returns true if the type passed has a Python wrapper for it. * Although namespace has a Python wrapper, it's not considered a type. */ - static bool isWrapperType(const TypeEntry* type); - static bool isWrapperType(const ComplexTypeEntry* type); - static bool isWrapperType(const AbstractMetaType* metaType); + static bool isWrapperType(const TypeEntry *type); + static bool isWrapperType(const ComplexTypeEntry *type); + static bool isWrapperType(const AbstractMetaType *metaType); /** * Checks if the type is an Object/QObject or pointer to Value Type. * In other words, tells if the type is "T*" and T has a Python wrapper. */ - static bool isPointerToWrapperType(const AbstractMetaType* type); + static bool isPointerToWrapperType(const AbstractMetaType *type); /** * Returns true if \p type is an Object Type used as a value. */ - static bool isObjectTypeUsedAsValueType(const AbstractMetaType* type); + static bool isObjectTypeUsedAsValueType(const AbstractMetaType *type); - static bool isValueTypeWithCopyConstructorOnly(const AbstractMetaClass* metaClass); - bool isValueTypeWithCopyConstructorOnly(const TypeEntry* type) const; - bool isValueTypeWithCopyConstructorOnly(const AbstractMetaType* type) const; + static bool isValueTypeWithCopyConstructorOnly(const AbstractMetaClass *metaClass); + bool isValueTypeWithCopyConstructorOnly(const TypeEntry *type) const; + bool isValueTypeWithCopyConstructorOnly(const AbstractMetaType *type) const; /// Returns true if the type is a primitive but not a C++ primitive. - static bool isUserPrimitive(const TypeEntry* type); - static bool isUserPrimitive(const AbstractMetaType* type); + static bool isUserPrimitive(const TypeEntry *type); + static bool isUserPrimitive(const AbstractMetaType *type); /// Returns true if the type is a C++ primitive, a void*, a const char*, or a std::string. - static bool isCppPrimitive(const TypeEntry* type); - static bool isCppPrimitive(const AbstractMetaType* type); + static bool isCppPrimitive(const TypeEntry *type); + static bool isCppPrimitive(const AbstractMetaType *type); /// Returns true if the type is a C++ integral primitive, i.e. bool, char, int, long, and their unsigned counterparts. - static bool isCppIntegralPrimitive(const TypeEntry* type); - static bool isCppIntegralPrimitive(const AbstractMetaType* type); + static bool isCppIntegralPrimitive(const TypeEntry *type); + static bool isCppIntegralPrimitive(const AbstractMetaType *type); /// Checks if an argument type should be dereferenced by the Python method wrapper before calling the C++ method. - static bool shouldDereferenceArgumentPointer(const AbstractMetaArgument* arg); + static bool shouldDereferenceArgumentPointer(const AbstractMetaArgument *arg); /// Checks if a meta type should be dereferenced by the Python method wrapper passing it to C++. - static bool shouldDereferenceAbstractMetaTypePointer(const AbstractMetaType* metaType); - - static bool visibilityModifiedToPrivate(const AbstractMetaFunction* func); - - QString converterObject(const AbstractMetaType* type); - QString converterObject(const TypeEntry* type); - - QString cpythonBaseName(const AbstractMetaClass* metaClass); - QString cpythonBaseName(const TypeEntry* type); - QString cpythonBaseName(const AbstractMetaType* type); - QString cpythonTypeName(const AbstractMetaClass* metaClass); - QString cpythonTypeName(const TypeEntry* type); - QString cpythonTypeNameExt(const TypeEntry* type); - QString cpythonTypeNameExt(const AbstractMetaType* type); - QString cpythonCheckFunction(const TypeEntry* type, bool genericNumberType = false); - QString cpythonCheckFunction(const AbstractMetaType* metaType, bool genericNumberType = false); + static bool shouldDereferenceAbstractMetaTypePointer(const AbstractMetaType *metaType); + + static bool visibilityModifiedToPrivate(const AbstractMetaFunction *func); + + QString converterObject(const AbstractMetaType *type); + QString converterObject(const TypeEntry *type); + + QString cpythonBaseName(const AbstractMetaClass *metaClass); + QString cpythonBaseName(const TypeEntry *type); + QString cpythonBaseName(const AbstractMetaType *type); + QString cpythonTypeName(const AbstractMetaClass *metaClass); + QString cpythonTypeName(const TypeEntry *type); + QString cpythonTypeNameExt(const TypeEntry *type); + QString cpythonTypeNameExt(const AbstractMetaType *type); + QString cpythonCheckFunction(const TypeEntry *type, bool genericNumberType = false); + QString cpythonCheckFunction(const AbstractMetaType *metaType, bool genericNumberType = false); /** * Receives the argument \p type and tries to find the appropriate AbstractMetaType for it * or a custom type check. @@ -306,28 +306,28 @@ protected: * \return A custom check if \p type is a custom type, or an empty string if \p metaType * receives an existing type object. */ - QString guessCPythonCheckFunction(const QString& type, AbstractMetaType** metaType); - QString cpythonIsConvertibleFunction(const TypeEntry* type, bool genericNumberType = false, bool checkExact = false); - QString cpythonIsConvertibleFunction(const AbstractMetaType* metaType, bool genericNumberType = false); - QString cpythonIsConvertibleFunction(const AbstractMetaArgument* metaArg, bool genericNumberType = false); - - QString cpythonToCppConversionFunction(const AbstractMetaClass* metaClass); - QString cpythonToCppConversionFunction(const AbstractMetaType* type, const AbstractMetaClass* context = 0); - QString cpythonToPythonConversionFunction(const AbstractMetaType* type, const AbstractMetaClass* context = 0); - QString cpythonToPythonConversionFunction(const AbstractMetaClass* metaClass); - QString cpythonToPythonConversionFunction(const TypeEntry* type); - - QString cpythonFunctionName(const AbstractMetaFunction* func); - QString cpythonMethodDefinitionName(const AbstractMetaFunction* func); - QString cpythonGettersSettersDefinitionName(const AbstractMetaClass* metaClass); - QString cpythonGetattroFunctionName(const AbstractMetaClass* metaClass); - QString cpythonSetattroFunctionName(const AbstractMetaClass* metaClass); - QString cpythonGetterFunctionName(const AbstractMetaField* metaField); - QString cpythonSetterFunctionName(const AbstractMetaField* metaField); - QString cpythonWrapperCPtr(const AbstractMetaClass* metaClass, + QString guessCPythonCheckFunction(const QString &type, AbstractMetaType **metaType); + QString cpythonIsConvertibleFunction(const TypeEntry *type, bool genericNumberType = false, bool checkExact = false); + QString cpythonIsConvertibleFunction(const AbstractMetaType *metaType, bool genericNumberType = false); + QString cpythonIsConvertibleFunction(const AbstractMetaArgument *metaArg, bool genericNumberType = false); + + QString cpythonToCppConversionFunction(const AbstractMetaClass *metaClass); + QString cpythonToCppConversionFunction(const AbstractMetaType *type, const AbstractMetaClass *context = nullptr); + QString cpythonToPythonConversionFunction(const AbstractMetaType *type, const AbstractMetaClass *context = nullptr); + QString cpythonToPythonConversionFunction(const AbstractMetaClass *metaClass); + QString cpythonToPythonConversionFunction(const TypeEntry *type); + + QString cpythonFunctionName(const AbstractMetaFunction *func); + QString cpythonMethodDefinitionName(const AbstractMetaFunction *func); + QString cpythonGettersSettersDefinitionName(const AbstractMetaClass *metaClass); + QString cpythonGetattroFunctionName(const AbstractMetaClass *metaClass); + QString cpythonSetattroFunctionName(const AbstractMetaClass *metaClass); + QString cpythonGetterFunctionName(const AbstractMetaField *metaField); + QString cpythonSetterFunctionName(const AbstractMetaField *metaField); + QString cpythonWrapperCPtr(const AbstractMetaClass *metaClass, const QString &argName = QLatin1String("self")); QString cpythonWrapperCPtr(const AbstractMetaType *metaType, const QString &argName); - QString cpythonWrapperCPtr(const TypeEntry* type, const QString &argName); + QString cpythonWrapperCPtr(const TypeEntry *type, const QString &argName); /// Guesses the scope to where belongs an argument's default value. QString guessScopeForDefaultValue(const AbstractMetaFunction *func, @@ -336,18 +336,18 @@ protected: const AbstractMetaArgument *arg, const QString &value) const; - QString cpythonEnumName(const EnumTypeEntry* enumEntry); - QString cpythonEnumName(const AbstractMetaEnum* metaEnum); + QString cpythonEnumName(const EnumTypeEntry *enumEntry); + QString cpythonEnumName(const AbstractMetaEnum *metaEnum); - QString cpythonFlagsName(const FlagsTypeEntry* flagsEntry); - QString cpythonFlagsName(const AbstractMetaEnum* metaEnum); + QString cpythonFlagsName(const FlagsTypeEntry *flagsEntry); + QString cpythonFlagsName(const AbstractMetaEnum *metaEnum); /// Returns the special cast function name, the function used to proper cast class with multiple inheritance. - QString cpythonSpecialCastFunctionName(const AbstractMetaClass* metaClass); + QString cpythonSpecialCastFunctionName(const AbstractMetaClass *metaClass); - QString getFormatUnitString(const AbstractMetaFunction* func, bool incRef = false) const; + QString getFormatUnitString(const AbstractMetaFunction *func, bool incRef = false) const; /// 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; + QString getModuleHeaderFileName(const QString &moduleName = QString()) const; OptionDescriptions options() const override; bool handleOption(const QString &key, const QString &value) override; @@ -362,18 +362,18 @@ protected: bool useIsNullAsNbNonZero() const; /// Returns true if the generated code should use the "#define protected public" hack. bool avoidProtectedHack() const; - QString cppApiVariableName(const QString& moduleName = QString()) const; - QString pythonModuleObjectName(const QString& moduleName = QString()) const; - QString convertersVariableName(const QString& moduleName = QString()) const; + QString cppApiVariableName(const QString &moduleName = QString()) const; + QString pythonModuleObjectName(const QString &moduleName = QString()) const; + QString convertersVariableName(const QString &moduleName = QString()) const; /** * Returns the type index variable name for a given class. If \p alternativeTemplateName is true * and the class is a typedef for a template class instantiation, it will return an alternative name * made of the template class and the instantiation values, or an empty string if the class isn't * derived from a template class at all. */ - QString getTypeIndexVariableName(const AbstractMetaClass* metaClass, bool alternativeTemplateName = false); - QString getTypeIndexVariableName(const TypeEntry* type); - QString getTypeIndexVariableName(const AbstractMetaType* type); + QString getTypeIndexVariableName(const AbstractMetaClass *metaClass, bool alternativeTemplateName = false); + QString getTypeIndexVariableName(const TypeEntry *type); + QString getTypeIndexVariableName(const AbstractMetaType *type); /// Returns true if the user don't want verbose error messages on the generated bindings. bool verboseErrorMessagesDisabled() const; @@ -389,16 +389,16 @@ protected: QString *errorMessage = nullptr); /// Creates an AbstractMetaType object from a TypeEntry. - AbstractMetaType* buildAbstractMetaTypeFromTypeEntry(const TypeEntry* typeEntry); + AbstractMetaType *buildAbstractMetaTypeFromTypeEntry(const TypeEntry *typeEntry); /// Creates an AbstractMetaType object from an AbstractMetaClass. - AbstractMetaType* buildAbstractMetaTypeFromAbstractMetaClass(const AbstractMetaClass* metaClass); + AbstractMetaType *buildAbstractMetaTypeFromAbstractMetaClass(const AbstractMetaClass *metaClass); - void writeMinimalConstructorExpression(QTextStream& s, const AbstractMetaType* type, const QString& defaultCtor = QString()); - void writeMinimalConstructorExpression(QTextStream& s, const TypeEntry* type, const QString& defaultCtor = QString()); + void writeMinimalConstructorExpression(QTextStream &s, const AbstractMetaType *type, const QString &defaultCtor = QString()); + void writeMinimalConstructorExpression(QTextStream &s, const TypeEntry *type, const QString &defaultCtor = QString()); - void collectContainerTypesFromConverterMacros(const QString& code, bool toPythonMacro); + void collectContainerTypesFromConverterMacros(const QString &code, bool toPythonMacro); // verify whether the class is copyable - bool isCopyable(const AbstractMetaClass* metaClass); + bool isCopyable(const AbstractMetaClass *metaClass); void clearTpFuncs(); @@ -408,17 +408,17 @@ protected: /// Initializes a list of Python known type names. static void initKnownPythonTypes(); - void writeFunctionCall(QTextStream& s, - const AbstractMetaFunction* metaFunc, + void writeFunctionCall(QTextStream &s, + const AbstractMetaFunction *metaFunc, Options options = NoOption) const; - void writeUnusedVariableCast(QTextStream& s, const QString& variableName); + void writeUnusedVariableCast(QTextStream &s, const QString &variableName); - AbstractMetaFunctionList filterFunctions(const AbstractMetaClass* metaClass); + AbstractMetaFunctionList filterFunctions(const AbstractMetaClass *metaClass); // All data about extended converters: the type entries of the target type, and a // list of AbstractMetaClasses accepted as argument for the conversion. - typedef QHash<const TypeEntry *, QVector<const AbstractMetaClass *> > ExtendedConverterData; + using ExtendedConverterData = QHash<const TypeEntry *, QVector<const AbstractMetaClass *> >; /// Returns all extended conversions for the current module. ExtendedConverterData getExtendedConverters() const; @@ -426,7 +426,7 @@ protected: QVector<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); + static bool pythonFunctionWrapperUsesListOfArguments(const OverloadData &overloadData); Indentor INDENT; @@ -446,8 +446,8 @@ private: static FunctionGroups getFunctionGroupsImpl(const AbstractMetaClass *scope); static bool classNeedsGetattroFunctionImpl(const AbstractMetaClass *metaClass); - QString translateTypeForWrapperMethod(const AbstractMetaType* cType, - const AbstractMetaClass* context, + QString translateTypeForWrapperMethod(const AbstractMetaType *cType, + const AbstractMetaClass *context, Options opt = NoOption) const; /** @@ -464,8 +464,8 @@ private: * \param scope scope used to search for overloads. * \param functionName the function name. */ - AbstractMetaFunctionList getFunctionOverloads(const AbstractMetaClass* scope, - const QString& functionName); + AbstractMetaFunctionList getFunctionOverloads(const AbstractMetaClass *scope, + const QString &functionName); /** * Write a function argument in the C++ in the text stream \p s. * This function just call \code s << argumentString(); \endcode @@ -475,8 +475,8 @@ private: * \param options some extra options. */ void writeArgument(QTextStream &s, - const AbstractMetaFunction* func, - const AbstractMetaArgument* argument, + const AbstractMetaFunction *func, + const AbstractMetaArgument *argument, Options options = NoOption) const; /** * Create a QString in the C++ format to an function argument. @@ -484,18 +484,18 @@ private: * \param argument metaargument information to be parsed. * \param options some extra options. */ - QString argumentString(const AbstractMetaFunction* func, - const AbstractMetaArgument* argument, + QString argumentString(const AbstractMetaFunction *func, + const AbstractMetaArgument *argument, Options options = NoOption) const; - QString functionReturnType(const AbstractMetaFunction* func, Options options = NoOption) const; + QString functionReturnType(const AbstractMetaFunction *func, Options options = NoOption) const; /// Utility function for writeCodeSnips. - typedef QPair<const AbstractMetaArgument*, QString> ArgumentVarReplacementPair; - typedef QVector<ArgumentVarReplacementPair> ArgumentVarReplacementList; + using ArgumentVarReplacementPair = QPair<const AbstractMetaArgument *, QString>; + using ArgumentVarReplacementList = QVector<ArgumentVarReplacementPair>; ArgumentVarReplacementList getArgumentReplacement(const AbstractMetaFunction* func, bool usePyArgs, TypeSystem::Language language, - const AbstractMetaArgument* lastArg); + const AbstractMetaArgument *lastArg); /// Returns a string with the user's custom code snippets that comply with \p position and \p language. QString getCodeSnippets(const QVector<CodeSnip> & codeSnips, @@ -509,31 +509,31 @@ private: TypeSystemToPythonFunction, TypeSystemConverterVariables }; - void replaceConverterTypeSystemVariable(TypeSystemConverterVariable converterVariable, QString& code); + void replaceConverterTypeSystemVariable(TypeSystemConverterVariable converterVariable, QString &code); /// Replaces the %CONVERTTOPYTHON type system variable. - inline void replaceConvertToPythonTypeSystemVariable(QString& code) + inline void replaceConvertToPythonTypeSystemVariable(QString &code) { replaceConverterTypeSystemVariable(TypeSystemToPythonFunction, code); } /// Replaces the %CONVERTTOCPP type system variable. - inline void replaceConvertToCppTypeSystemVariable(QString& code) + inline void replaceConvertToCppTypeSystemVariable(QString &code) { replaceConverterTypeSystemVariable(TypeSystemToCppFunction, code); } /// Replaces the %ISCONVERTIBLE type system variable. - inline void replaceIsConvertibleToCppTypeSystemVariable(QString& code) + inline void replaceIsConvertibleToCppTypeSystemVariable(QString &code) { replaceConverterTypeSystemVariable(TypeSystemIsConvertibleFunction, code); } /// Replaces the %CHECKTYPE type system variable. - inline void replaceTypeCheckTypeSystemVariable(QString& code) + inline void replaceTypeCheckTypeSystemVariable(QString &code) { replaceConverterTypeSystemVariable(TypeSystemCheckFunction, code); } /// Return a prefix with '_' suitable for names in C++ - QString moduleCppPrefix(const QString& moduleName = QString()) const; + QString moduleCppPrefix(const QString &moduleName = QString()) const; bool m_useCtorHeuristic = false; bool m_userReturnValueHeuristic = false; @@ -542,7 +542,7 @@ private: bool m_useIsNullAsNbNonZero = false; bool m_avoidProtectedHack = false; - typedef QHash<QString, AbstractMetaType*> AbstractMetaTypeCache; + using AbstractMetaTypeCache = QHash<QString, AbstractMetaType *>; AbstractMetaTypeCache m_metaTypeFromStringCache; /// Type system converter variable replacement names and regular expressions. |