The QScriptString class acts as a handle to "interned" strings in a QScriptEngine. More...
#include <QScriptString>
This class was introduced in Qt 4.4.
QScriptString () | |
QScriptString ( const QScriptString & other ) | |
~QScriptString () | |
bool | isValid () const |
quint32 | toArrayIndex ( bool * ok = 0 ) const |
QString | toString () const |
operator QString () const | |
bool | operator!= ( const QScriptString & other ) const |
QScriptString & | operator= ( const QScriptString & other ) |
bool | operator== ( const QScriptString & other ) const |
The QScriptString class acts as a handle to "interned" strings in a QScriptEngine.
QScriptString can be used to achieve faster (repeated) property getting/setting, and comparison of property names, of script objects.
To get a QScriptString representation of a string, pass the string to QScriptEngine::toStringHandle(). The typical usage pattern is to register one or more pre-defined strings when setting up your script environment, then subsequently use the relevant QScriptString as argument to e.g. QScriptValue::property().
Call the toString() function to obtain the string that a QScriptString represents.
Call the toArrayIndex() function to convert a QScriptString to an array index. This is useful when using QScriptClass to implement array-like objects.
Constructs an invalid QScriptString.
Constructs a new QScriptString that is a copy of other.
Destroys this QScriptString.
Returns true if this QScriptString is valid; otherwise returns false.
Attempts to convert this QScriptString to a QtScript array index, and returns the result.
If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
This function was introduced in Qt 4.6.
Returns the string that this QScriptString represents, or a null string if this QScriptString is not valid.
See also isValid().
Returns the string that this QScriptString represents, or a null string if this QScriptString is not valid.
See also toString().
Returns true if this QScriptString is not equal to other; otherwise returns false.
Assigns the other value to this QScriptString.
Returns true if this QScriptString is equal to other; otherwise returns false.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.