aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/modifications.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-30 18:39:25 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-07 12:31:15 +0000
commited87e710dd14bc9612dcfdba2e09143201768556 (patch)
tree0c7dd4b49e4a891c57d514fca39642abfaad91f6 /sources/shiboken6/ApiExtractor/modifications.cpp
parenteb16797b9a54970dbc0c461ebeddda57b060af22 (diff)
shiboken6: Add support for a snake case typesystem attribute
Add a snake case attribute to type system, complex type entry, function type entry as well as to function and field modifications. Add a function definitionNames() to AbstractMetaFunction/Field returning the names under which the function/field will be registered. Change the code writing the registration accordingly. Fixes: PYSIDE-1441 Change-Id: I178390bb80fa25aad9f8a56e99e4cc70064178eb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/modifications.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/modifications.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/modifications.cpp b/sources/shiboken6/ApiExtractor/modifications.cpp
index eba1437dc..9e5071a33 100644
--- a/sources/shiboken6/ApiExtractor/modifications.cpp
+++ b/sources/shiboken6/ApiExtractor/modifications.cpp
@@ -173,6 +173,7 @@ public:
bool m_readable = true;
bool m_writable = true;
bool m_removed = false;
+ TypeSystem::SnakeCase snakeCase = TypeSystem::SnakeCase::Unspecified;
};
FieldModification::FieldModification() : d(new FieldModificationData)
@@ -245,6 +246,17 @@ void FieldModification::setRemoved(bool r)
d->m_removed = r;
}
+TypeSystem::SnakeCase FieldModification::snakeCase() const
+{
+ return d->snakeCase;
+}
+
+void FieldModification::setSnakeCase(TypeSystem::SnakeCase s)
+{
+ if (d->snakeCase != s)
+ d->snakeCase = s;
+}
+
// Helpers to split a parameter list of <add-function>, <declare-function>
// (@ denoting names), like
// "void foo(QList<X,Y> &@list@ = QList<X,Y>{1,2}, int @b@=5, ...)"
@@ -716,6 +728,7 @@ public:
bool m_thread = false;
TypeSystem::AllowThread m_allowThread = TypeSystem::AllowThread::Unspecified;
TypeSystem::ExceptionHandling m_exceptionHandling = TypeSystem::ExceptionHandling::Unspecified;
+ TypeSystem::SnakeCase snakeCase = TypeSystem::SnakeCase::Unspecified;
};
FunctionModification::FunctionModification() : d(new FunctionModificationData)
@@ -763,6 +776,17 @@ void FunctionModification::setArgument_mods(const QList<ArgumentModification> &a
d->m_argument_mods = argument_mods;
}
+TypeSystem::SnakeCase FunctionModification::snakeCase() const
+{
+ return d->snakeCase;
+}
+
+void FunctionModification::setSnakeCase(TypeSystem::SnakeCase s)
+{
+ if (d->snakeCase != s)
+ d->snakeCase = s;
+}
+
const CodeSnipList &FunctionModification::snips() const
{
return d->m_snips;