17#include <QtCore/qstring.h>
19#include <QtCore/private/qnumeric_p.h>
21#include <private/qv4stringtoarrayindex_p.h>
27struct ExecutionEngine;
41 StringType_Complex = StringType_AddedString
69 void createHashValue()
const;
71 if (subtype >= StringType_Unknown)
73 Q_ASSERT(subtype < StringType_Complex);
83 return internalClass->vtable;
87 void simplifyString()
const;
90 return subtype >= StringType_Complex ? 0 : (std::size_t(
text().
size) *
sizeof(
QChar));
93 if (subtype >= StringType_Complex)
95 return StringOrSymbol::toQString();
100 if (hashValue() !=
other->hashValue())
102 Q_ASSERT(subtype < StringType_Complex);
103 if (identifier.isValid() && identifier ==
other->identifier)
105 if (subtype == Heap::String::StringType_ArrayIndex &&
other->subtype == Heap::String::StringType_ArrayIndex)
108 return toQString() ==
other->toQString();
111 bool startsWithUpper()
const;
143 IsStringOrSymbol =
true
147 inline void createPropertyKey()
const;
154 return d()->toQString();
170 return d()->isEqualTo(
other->d());
173 return d()->isEqualTo(
other->d());
177 return toQString() <
other->toQString();
181 return d()->toQString();
185 return d()->hashValue();
187 uint toUInt(
bool *
ok)
const;
195 return calculateHashValue(
ch,
end, subtype);
201 return calculateHashValue(
ch,
end, subtype);
211 template <
typename T>
218 *subtype = Heap::StringOrSymbol::StringType_ArrayIndex;
228 *subtype = (
ch !=
end &&
charToUInt(
ch) ==
'@') ? Heap::StringOrSymbol::StringType_Symbol : Heap::StringOrSymbol::StringType_Regular;
244void StringOrSymbol::createPropertyKey()
const {
247 static_cast<const String *
>(
this)->createPropertyKeyImpl();
251 if (!
d()->identifier.isValid())
253 return d()->identifier;
258 return isManaged() &&
m()->internalClass->vtable->isStringOrSymbol ?
static_cast<const String *
>(
this) :
nullptr;
263 return isManaged() &&
m()->internalClass->vtable->isString ?
static_cast<const String *
>(
this) :
nullptr;
269 return v.toString(
e)->asReturnedValue();
\macro QT_RESTRICTED_CAST_FROM_ASCII
list append(new Employee("Blackpool", "Stephen"))
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
ReturnedValue value_convert< String >(ExecutionEngine *e, const Value &v)
uint stringToArrayIndex(const T *ch, const T *end)
uint charToUInt(const QChar *ch)
#define Q_STATIC_ASSERT(Condition)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h
QArrayDataPointer< char16_t > QStringPrivate
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define V4_MANAGED(DataClass, superClass)
#define Q_MANAGED_TYPE(type)
#define V4_INTERNALCLASS(c)
QV4::Heap::ComplexString * d_unchecked() const
QV4::Heap::ComplexString Data
QV4::Heap::ComplexString * d() const
Q_ALWAYS_INLINE void _checkIsInitialized()
QStringPrivate & text() const
unsigned hashValue() const
QString toQString() const
void init(QStringPrivate text)
QString toQString() const
bool isEqualTo(const String *other) const
const VTable * vtable() const
std::size_t retainedTextSize() const
PropertyKey propertyKey() const
QString toQString() const
PropertyKey toPropertyKey() const
bool isEqualTo(const String *other) const
static uint createHashValue(const char *ch, int length, uint *subtype)
void setSubtype(uchar subtype) const
bool equals(String *other) const
bool lessThan(const String *other)
bool startsWithUpper() const
QString toQString() const
static uint calculateHashValue(const T *ch, const T *end, uint *subtype)
unsigned hashValue() const
static uint createHashValue(const QChar *ch, int length, uint *subtype)