Qt 4.8
Public Functions | Properties | List of all members
QScriptDeclarativeClass::Value Class Reference

The QScriptDeclarativeClass::Value class acts as a container for JavaScript data types. More...

#include <qscriptdeclarativeclass_p.h>

Public Functions

QScriptValue toScriptValue (QScriptEngine *) const
 
 Value ()
 
 Value (const Value &)
 
 Value (QScriptContext *, int)
 
 Value (QScriptContext *, uint)
 
 Value (QScriptContext *, bool)
 
 Value (QScriptContext *, double)
 
 Value (QScriptContext *, float)
 
 Value (QScriptContext *, const QString &)
 
 Value (QScriptContext *, const QScriptValue &)
 
 Value (QScriptEngine *, int)
 
 Value (QScriptEngine *, uint)
 
 Value (QScriptEngine *, bool)
 
 Value (QScriptEngine *, double)
 
 Value (QScriptEngine *, float)
 
 Value (QScriptEngine *, const QString &)
 
 Value (QScriptEngine *, const QScriptValue &)
 
 ~Value ()
 

Properties

char dummy [8]
 

Detailed Description

The QScriptDeclarativeClass::Value class acts as a container for JavaScript data types.

Warning
This function is not part of the public interface.

QScriptDeclarativeClass::Value class is similar to QScriptValue, but it is slightly faster. Unlike QScriptValue, however, Value instances cannot be stored as they may not survive garbage collection. If you need to store a Value, convert it to a QScriptValue and store that.

Definition at line 51 of file qscriptdeclarativeclass_p.h.

Constructors and Destructors

◆ Value() [1/16]

QScriptDeclarativeClass::Value::Value ( )

Definition at line 52 of file qscriptdeclarativeclass.cpp.

53 {
54  new (this) JSC::JSValue(JSC::jsUndefined());
55 }

◆ Value() [2/16]

QScriptDeclarativeClass::Value::Value ( const Value other)

Definition at line 57 of file qscriptdeclarativeclass.cpp.

58 {
59  new (this) JSC::JSValue((JSC::JSValue &)other);
60 }

◆ Value() [3/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ctxt,
int  value 
)

Definition at line 67 of file qscriptdeclarativeclass.cpp.

68 {
69  new (this) JSC::JSValue(QScriptEnginePrivate::frameForContext(ctxt), value);
70 }
static JSC::ExecState * frameForContext(QScriptContext *context)

◆ Value() [4/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ctxt,
uint  value 
)

Definition at line 72 of file qscriptdeclarativeclass.cpp.

73 {
74  new (this) JSC::JSValue(QScriptEnginePrivate::frameForContext(ctxt), value);
75 }
static JSC::ExecState * frameForContext(QScriptContext *context)

◆ Value() [5/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ,
bool  value 
)

Definition at line 77 of file qscriptdeclarativeclass.cpp.

78 {
79  if (value)
80  new (this) JSC::JSValue(JSC::JSValue::JSTrue);
81  else
82  new (this) JSC::JSValue(JSC::JSValue::JSFalse);
83 }

◆ Value() [6/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ctxt,
double  value 
)

Definition at line 85 of file qscriptdeclarativeclass.cpp.

86 {
87  new (this) JSC::JSValue(QScriptEnginePrivate::frameForContext(ctxt), value);
88 }
static JSC::ExecState * frameForContext(QScriptContext *context)

◆ Value() [7/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ctxt,
float  value 
)

Definition at line 90 of file qscriptdeclarativeclass.cpp.

91 {
92  new (this) JSC::JSValue(QScriptEnginePrivate::frameForContext(ctxt), value);
93 }
static JSC::ExecState * frameForContext(QScriptContext *context)

◆ Value() [8/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ctxt,
const QString value 
)

Definition at line 95 of file qscriptdeclarativeclass.cpp.

96 {
97  new (this) JSC::JSValue(JSC::jsString(QScriptEnginePrivate::frameForContext(ctxt), value));
98 }
static JSC::ExecState * frameForContext(QScriptContext *context)

◆ Value() [9/16]

QScriptDeclarativeClass::Value::Value ( QScriptContext ctxt,
const QScriptValue value 
)

Definition at line 100 of file qscriptdeclarativeclass.cpp.

101 {
102  new (this) JSC::JSValue(QScriptEnginePrivate::get(ctxt->engine())->scriptValueToJSCValue(value));
103 }
static QScriptEnginePrivate * get(QScriptEngine *q)
QScriptEngine * engine() const
Returns the QScriptEngine that this QScriptContext belongs to.

◆ Value() [10/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
int  value 
)

Definition at line 105 of file qscriptdeclarativeclass.cpp.

106 {
107  new (this) JSC::JSValue(QScriptEnginePrivate::get(eng)->currentFrame, value);
108 }
static QScriptEnginePrivate * get(QScriptEngine *q)
JSC::ExecState * currentFrame

◆ Value() [11/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
uint  value 
)

Definition at line 110 of file qscriptdeclarativeclass.cpp.

111 {
112  new (this) JSC::JSValue(QScriptEnginePrivate::get(eng)->currentFrame, value);
113 }
static QScriptEnginePrivate * get(QScriptEngine *q)
JSC::ExecState * currentFrame

◆ Value() [12/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
bool  value 
)

Definition at line 115 of file qscriptdeclarativeclass.cpp.

116 {
117  if (value)
118  new (this) JSC::JSValue(JSC::JSValue::JSTrue);
119  else
120  new (this) JSC::JSValue(JSC::JSValue::JSFalse);
121 }

◆ Value() [13/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
double  value 
)

Definition at line 123 of file qscriptdeclarativeclass.cpp.

124 {
125  new (this) JSC::JSValue(QScriptEnginePrivate::get(eng)->currentFrame, value);
126 }
static QScriptEnginePrivate * get(QScriptEngine *q)
JSC::ExecState * currentFrame

◆ Value() [14/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
float  value 
)

Definition at line 128 of file qscriptdeclarativeclass.cpp.

129 {
130  new (this) JSC::JSValue(QScriptEnginePrivate::get(eng)->currentFrame, value);
131 }
static QScriptEnginePrivate * get(QScriptEngine *q)
JSC::ExecState * currentFrame

◆ Value() [15/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
const QString value 
)

Definition at line 133 of file qscriptdeclarativeclass.cpp.

134 {
135  new (this) JSC::JSValue(JSC::jsString(QScriptEnginePrivate::get(eng)->currentFrame, value));
136 }
static QScriptEnginePrivate * get(QScriptEngine *q)

◆ Value() [16/16]

QScriptDeclarativeClass::Value::Value ( QScriptEngine eng,
const QScriptValue value 
)

Definition at line 138 of file qscriptdeclarativeclass.cpp.

139 {
140  new (this) JSC::JSValue(QScriptEnginePrivate::get(eng)->scriptValueToJSCValue(value));
141 }
static QScriptEnginePrivate * get(QScriptEngine *q)
JSC::JSValue scriptValueToJSCValue(const QScriptValue &value)

◆ ~Value()

QScriptDeclarativeClass::Value::~Value ( )

Definition at line 143 of file qscriptdeclarativeclass.cpp.

144 {
145  ((JSC::JSValue *)(this))->~JSValue();
146 }

Functions

◆ toScriptValue()

QScriptValue QScriptDeclarativeClass::Value::toScriptValue ( QScriptEngine engine) const

Definition at line 148 of file qscriptdeclarativeclass.cpp.

149 {
150  return QScriptEnginePrivate::get(engine)->scriptValueFromJSCValue((JSC::JSValue &)*this);
151 }
static QScriptEnginePrivate * get(QScriptEngine *q)
QScriptValue scriptValueFromJSCValue(JSC::JSValue value)

Properties

◆ dummy

char QScriptDeclarativeClass::Value::dummy[8]
private

Definition at line 75 of file qscriptdeclarativeclass_p.h.


The documentation for this class was generated from the following files: