aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/generator.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/generator/generator.h')
-rw-r--r--sources/shiboken6/generator/generator.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/sources/shiboken6/generator/generator.h b/sources/shiboken6/generator/generator.h
index 9d87ada6b..5b051b599 100644
--- a/sources/shiboken6/generator/generator.h
+++ b/sources/shiboken6/generator/generator.h
@@ -15,6 +15,8 @@
class ApiExtractorResult;
class GeneratorContext;
class DefaultValue;
+struct OptionDescription;
+class OptionsParser;
class TextStream;
QString getClassTargetFullName(const AbstractMetaClassCPtr &metaClass,
@@ -28,12 +30,11 @@ QString getFilteredCppSignatureString(QString signature);
* you must subclass this to create your own generators.
*/
class Generator
-{
+{;
public:
- using OptionDescription = QPair<QString, QString>;
- using OptionDescriptions = QList<OptionDescription>;
+ Q_DISABLE_COPY_MOVE(Generator)
- /// Optiosn used around the generator code
+ /// Options used around the generator code
enum Option {
NoOption = 0x00000000,
ExcludeConst = 0x00000001,
@@ -59,8 +60,8 @@ public:
bool setup(const ApiExtractorResult &api);
- virtual OptionDescriptions options() const;
- virtual bool handleOption(const QString &key, const QString &value);
+ static QList<OptionDescription> options();
+ static std::shared_ptr<OptionsParser> createOptionsParser();
/// Returns the top namespace made invisible
const AbstractMetaClassCList &invisibleTopNamespaces() const;
@@ -94,10 +95,10 @@ public:
bool hasPrivateClasses() const;
/// Returns true if the user enabled PySide extensions (command line option)
- bool usePySideExtensions() const;
+ static bool usePySideExtensions();
/// Returns true if the generated code should not use the
/// "#define protected public" hack.
- bool avoidProtectedHack() const;
+ static bool avoidProtectedHack();
/**
* Retrieves the name of the currently processed module.
@@ -110,6 +111,7 @@ public:
static QString moduleName();
static QString pythonOperatorFunctionName(const QString &cppOpFuncName);
+ static bool isPythonOperatorFunctionName(const QString &cppOpFuncName);
protected:
/// Helper for determining the file name
@@ -212,6 +214,11 @@ protected:
*/
virtual QString subDirectoryForPackage(QString packageName = QString()) const;
+ static QString addGlobalScopePrefix(const QString &t);
+ static QString globalScopePrefix(const GeneratorContext &classContext);
+
+ static QString m_gsp;
+
private:
struct GeneratorPrivate;
GeneratorPrivate *m_d;