diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-12-01 11:10:59 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-12-01 15:25:42 +0000 |
commit | f379fe417a31981cf923930cae8799dc775a9b5f (patch) | |
tree | ee9b03aba796a7e9d5b44c0df2f1738ae1ec3e67 /sources/shiboken6/generator/shiboken/shibokengenerator.h | |
parent | 7cc341813c2c34520e8af610d34de0dfded8a67c (diff) |
shiboken6: Use initializer lists for the converter replacement regexps
Complements 28aa3c4f6605a6331b12f47e03a9aba4aaefe201.
Change-Id: I2814ce4832a6cf7623abb9e6e290773377795565
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/shibokengenerator.h')
-rw-r--r-- | sources/shiboken6/generator/shiboken/shibokengenerator.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.h b/sources/shiboken6/generator/shiboken/shibokengenerator.h index b20a64515..4a73e0c6d 100644 --- a/sources/shiboken6/generator/shiboken/shibokengenerator.h +++ b/sources/shiboken6/generator/shiboken/shibokengenerator.h @@ -51,6 +51,8 @@ extern const char *END_ALLOW_THREADS; #include <QtCore/QRegularExpression> +#include <array> + class DocParser; class CodeSnip; class QPropertySpec; @@ -366,8 +368,8 @@ protected: /// Returns true if the Python wrapper for the received OverloadData must accept a list of arguments. static bool pythonFunctionWrapperUsesListOfArguments(const OverloadData &overloadData); - const QRegularExpression &convertToCppRegEx() const - { return m_typeSystemConvRegEx[TypeSystemToCppFunction]; } + static const QRegularExpression &convertToCppRegEx() + { return typeSystemConvRegExps()[TypeSystemToCppFunction]; } static QString pythonArgsAt(int i); @@ -502,7 +504,9 @@ private: /// Type system converter variable replacement names and regular expressions. static const QHash<int, QString> &typeSystemConvName(); - QRegularExpression m_typeSystemConvRegEx[TypeSystemConverterVariables]; + + using TypeSystemConverterRegExps = std::array<QRegularExpression, TypeSystemConverterVariables>; + static const TypeSystemConverterRegExps &typeSystemConvRegExps(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(ShibokenGenerator::AttroCheck); |