diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-13 14:53:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-19 04:32:04 +0000 |
commit | 409ab08566897d304640f04caef20e72949dca6a (patch) | |
tree | 0c60d77b38dfa3d2158a8a970fa870de05b186e6 /sources/shiboken2/ApiExtractor/typesystem.h | |
parent | 22abf720dcfa248cf4884e4ac664f6d214c0f790 (diff) |
shiboken: Refactor attribute enumeration lookups in parser
Replace the static QHashes in Handler::startElement() and other places
which required converting and lower-casing the QStringRef's returned
by the QXmlStreamReader by lookup functions that take a QStringView,
which can be constructed from QString or QStringRef.
Task-number: PYSIDE-743
Change-Id: I10234f2ddfff13ee7e0ee67f9aee118a088e5ab8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typesystem.h | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h index 86eb694e6..64f41ce16 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.h +++ b/sources/shiboken2/ApiExtractor/typesystem.h @@ -237,6 +237,7 @@ struct ArgumentModification struct Modification { enum Modifiers { + InvalidModifier = 0x0000, Private = 0x0001, Protected = 0x0002, Public = 0x0003, @@ -398,6 +399,7 @@ struct AddedFunction { /// Function access types. enum Access { + InvalidAccess = 0, Protected = 0x1, Public = 0x2 }; @@ -1461,26 +1463,6 @@ public: QString targetLangName() const override; QString qualifiedCppName() const override; - static Type containerTypeFromString(QString typeName) - { - static QHash<QString, Type> m_stringToContainerType; - if (m_stringToContainerType.isEmpty()) { - m_stringToContainerType.insert(QLatin1String("list"), ListContainer); - m_stringToContainerType.insert(QLatin1String("string-list"), StringListContainer); - m_stringToContainerType.insert(QLatin1String("linked-list"), LinkedListContainer); - m_stringToContainerType.insert(QLatin1String("vector"), VectorContainer); - m_stringToContainerType.insert(QLatin1String("stack"), StackContainer); - m_stringToContainerType.insert(QLatin1String("queue"), QueueContainer); - m_stringToContainerType.insert(QLatin1String("set"), SetContainer); - m_stringToContainerType.insert(QLatin1String("map"), MapContainer); - m_stringToContainerType.insert(QLatin1String("multi-map"), MultiMapContainer); - m_stringToContainerType.insert(QLatin1String("hash"), HashContainer); - m_stringToContainerType.insert(QLatin1String("multi-hash"), MultiHashContainer); - m_stringToContainerType.insert(QLatin1String("pair"), PairContainer); - } - return m_stringToContainerType.value(typeName, NoContainer); - } - private: Type m_type; }; |