Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qv4identifierhash_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QV4IDENTIFIERHASH_P_H
4#define QV4IDENTIFIERHASH_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <qstring.h>
18#include <private/qv4global_p.h>
19#include <private/qv4propertykey_p.h>
20
22
23namespace QV4 {
24
25struct IdentifierHashEntry;
26struct IdentifierHashData;
27struct Q_QML_EXPORT IdentifierHash
28{
29 IdentifierHash() = default;
33 IdentifierHash &operator=(const IdentifierHash &other);
34
35 bool isEmpty() const { return !d; }
36
37 int count() const;
38
39 void detach();
40
41 void add(const QString &str, int value);
42 void add(Heap::String *str, int value);
43
44 int value(const QString &str) const;
45 int value(String *str) const;
46 QString findId(int value) const;
47
48private:
49 inline IdentifierHashEntry *addEntry(PropertyKey i);
50 inline const IdentifierHashEntry *lookup(PropertyKey identifier) const;
51 inline const IdentifierHashEntry *lookup(const QString &str) const;
52 inline const IdentifierHashEntry *lookup(String *str) const;
53 inline const PropertyKey toIdentifier(const QString &str) const;
54 inline const PropertyKey toIdentifier(Heap::String *str) const;
55
56 IdentifierHashData *d = nullptr;
57};
58
59} // namespace QV4
60
62
63#endif // QV4_IDENTIFIERHASH_P_H
static AVMetadataIdentifier toIdentifier(QMediaMetaData::Key key, AVMetadataKeySpace keySpace)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString str
[2]
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLenum GLsizei count
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
QSharedPointer< T > other(t)
[5]
QJSEngine engine
[0]
IdentifierHash()=default