KJS
22 #ifndef KJS_IDENTIFIER_H
23 #define KJS_IDENTIFIER_H
27 #include <wtf/HashFunctions.h>
28 #include <wtf/HashTraits.h>
52 explicit Identifier(UString::Rep *rep) : _ustring(add(rep)) { }
53 explicit Identifier(
const UString &s) : _ustring(
add(s.rep())) { }
66 KJS_EXTERNAL_EXPORT
QString qstring()
const;
73 return _ustring.data();
80 return _ustring.size();
88 return _ustring.ascii();
101 return _ustring.isNull();
108 return _ustring.isEmpty();
111 uint32_t toStrictUInt32(
bool *ok)
const
113 return _ustring.toStrictUInt32(ok);
115 unsigned toArrayIndex(
bool *ok)
const
117 return _ustring.toArrayIndex(ok);
119 double toDouble()
const
121 return _ustring.toDouble();
124 friend bool operator==(
const Identifier &,
const Identifier &);
125 friend bool operator!=(
const Identifier &,
const Identifier &);
127 friend bool operator==(
const Identifier &,
const char *);
129 static void remove(UString::Rep *);
130 static bool equal(
const UString::Rep *,
const char *);
131 static bool equal(
const UString::Rep *,
const UChar *,
int length);
136 static bool equal(
const Identifier &a,
const Identifier &b)
138 return a._ustring.rep() == b._ustring.rep();
140 static bool equal(
const Identifier &a,
const char *b)
142 return equal(a._ustring.rep(), b);
145 static PassRefPtr<UString::Rep>
add(
const char *);
146 static PassRefPtr<UString::Rep>
add(
const UChar *,
int length);
147 static PassRefPtr<UString::Rep>
add(UString::Rep *r)
149 if (r->isIdentifier) {
152 return addSlowCase(r);
154 static PassRefPtr<UString::Rep> addSlowCase(UString::Rep *r);
157 inline bool operator==(
const Identifier &a,
const Identifier &b)
159 return Identifier::equal(a, b);
162 inline bool operator!=(
const Identifier &a,
const Identifier &b)
164 return !Identifier::equal(a, b);
167 inline bool operator==(
const Identifier &a,
const char *b)
169 return Identifier::equal(a, b);
174 #endif // KJS_IDENTIFIER_H
const UString & ustring() const
returns a UString of the identifier
bool isEmpty() const
Returns that the identifiers string is set, but is empty.
Identifier(const char *s)
Creates an identifier with the name of the string.
const char * ascii() const
Char * of the identifier's string.
bool isNull() const
Returns the identfiers state of being unset.
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Represents an Identifier for a Javascript object.
bool remove(const QString &column, const QVariant &value)
bool operator!=(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
static UString from(int i)
Constructs a string from an int.
const UChar * data() const
returns a UChar pointer to the string of the identifier with a size defined by size().
int size() const
The size of the UChar string returned.
Identifier()
Creates an empty identifier.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 03:58:44 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.