Qt 4.8
Public Types | Public Functions | Properties | Friends | List of all members
QScriptDebuggerResponse Class Reference

The QScriptDebuggerResponse class represents a front-end's response to a QScriptDebuggerCommand. More...

#include <qscriptdebuggerresponse_p.h>

Public Types

enum  Error {
  NoError, InvalidContextIndex, InvalidArgumentIndex, InvalidScriptID,
  InvalidBreakpointID, UserError = 1000, MaxUserError = 32767
}
 

Public Functions

bool async () const
 
Error error () const
 Returns the error code of this response. More...
 
bool operator!= (const QScriptDebuggerResponse &other) const
 Returns true if this QScriptDebuggerResponse is not equal to the other response, otherwise returns false. More...
 
QScriptDebuggerResponseoperator= (const QScriptDebuggerResponse &other)
 
bool operator== (const QScriptDebuggerResponse &other) const
 Returns true if this QScriptDebuggerResponse is equal to the other response, otherwise returns false. More...
 
 QScriptDebuggerResponse ()
 
 QScriptDebuggerResponse (const QScriptDebuggerResponse &other)
 
QVariant result () const
 Returns the result of this response. More...
 
QScriptBreakpointData resultAsBreakpointData () const
 
QScriptBreakpointMap resultAsBreakpoints () const
 
QScriptContextInfo resultAsContextInfo () const
 
int resultAsInt () const
 
qint64 resultAsLongLong () const
 
QScriptScriptData resultAsScriptData () const
 
QScriptScriptMap resultAsScripts () const
 
QScriptDebuggerValue resultAsScriptValue () const
 
QScriptDebuggerValueList resultAsScriptValueList () const
 
QScriptDebuggerValuePropertyList resultAsScriptValuePropertyList () const
 
QString resultAsString () const
 
void setAsync (bool async)
 
void setError (Error error)
 Sets the error code of this response. More...
 
void setResult (const QVariant &value)
 Sets the Result attribute of this response to the given value. More...
 
void setResult (int value)
 
void setResult (const QString &value)
 
void setResult (const QScriptBreakpointData &data)
 
void setResult (const QScriptBreakpointMap &breakpoints)
 
void setResult (const QScriptScriptMap &scripts)
 
void setResult (const QScriptScriptData &data)
 
void setResult (const QScriptDebuggerValue &value)
 
void setResult (const QScriptDebuggerValueList &value)
 
void setResult (const QScriptDebuggerValuePropertyList &props)
 
void setResult (const QScriptContextInfo &info)
 
 ~QScriptDebuggerResponse ()
 

Properties

QScopedPointer< QScriptDebuggerResponsePrivated_ptr
 

Friends

Q_AUTOTEST_EXPORT QDataStreamoperator<< (QDataStream &, const QScriptDebuggerResponse &)
 Writes the given response to the specified stream. More...
 
Q_AUTOTEST_EXPORT QDataStreamoperator>> (QDataStream &, QScriptDebuggerResponse &)
 Reads a QScriptDebuggerResponse from the specified stream into the given response. More...
 

Detailed Description

The QScriptDebuggerResponse class represents a front-end's response to a QScriptDebuggerCommand.

Since
4.5
Warning
This function is not part of the public interface.

A response contains an error code and result.

Definition at line 72 of file qscriptdebuggerresponse_p.h.

Enumerations

◆ Error

Constructors and Destructors

◆ QScriptDebuggerResponse() [1/2]

QScriptDebuggerResponse::QScriptDebuggerResponse ( )

Definition at line 94 of file qscriptdebuggerresponse.cpp.

96 {
97 }
QScopedPointer< QScriptDebuggerResponsePrivate > d_ptr

◆ QScriptDebuggerResponse() [2/2]

QScriptDebuggerResponse::QScriptDebuggerResponse ( const QScriptDebuggerResponse other)

Definition at line 99 of file qscriptdebuggerresponse.cpp.

101 {
102  *d_ptr = *other.d_ptr;
103 }
QScopedPointer< QScriptDebuggerResponsePrivate > d_ptr

◆ ~QScriptDebuggerResponse()

QScriptDebuggerResponse::~QScriptDebuggerResponse ( )

Definition at line 105 of file qscriptdebuggerresponse.cpp.

106 {
107 }

Functions

◆ async()

bool QScriptDebuggerResponse::async ( ) const

Definition at line 279 of file qscriptdebuggerresponse.cpp.

Referenced by debuggerResponseToScriptValue(), QScriptDebuggerPrivate::handleResponse(), and setAsync().

280 {
282  return d->async;
283 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ error()

QScriptDebuggerResponse::Error QScriptDebuggerResponse::error ( ) const

Returns the error code of this response.

Definition at line 118 of file qscriptdebuggerresponse.cpp.

Referenced by debuggerResponseToScriptValue(), QScriptDebuggerPrivate::handleResponse(), operator>>(), and setError().

119 {
121  return d->error;
122 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ operator!=()

bool QScriptDebuggerResponse::operator!= ( const QScriptDebuggerResponse other) const

Returns true if this QScriptDebuggerResponse is not equal to the other response, otherwise returns false.

Definition at line 312 of file qscriptdebuggerresponse.cpp.

313 {
314  return !(*this == other);
315 }

◆ operator=()

QScriptDebuggerResponse & QScriptDebuggerResponse::operator= ( const QScriptDebuggerResponse other)

Definition at line 109 of file qscriptdebuggerresponse.cpp.

110 {
111  *d_ptr = *other.d_ptr;
112  return *this;
113 }
QScopedPointer< QScriptDebuggerResponsePrivate > d_ptr

◆ operator==()

bool QScriptDebuggerResponse::operator== ( const QScriptDebuggerResponse other) const

Returns true if this QScriptDebuggerResponse is equal to the other response, otherwise returns false.

Definition at line 295 of file qscriptdebuggerresponse.cpp.

296 {
298  const QScriptDebuggerResponsePrivate *od = other.d_func();
299  if (d == od)
300  return true;
301  if (!d || !od)
302  return false;
303  return ((d->error == od->error)
304  && (d->result == od->result)
305  && (d->async == od->async));
306 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
QScriptDebuggerResponse::Error error

◆ result()

QVariant QScriptDebuggerResponse::result ( ) const

Returns the result of this response.

This function is provided for convenience.

Definition at line 137 of file qscriptdebuggerresponse.cpp.

Referenced by debuggerResponseToScriptValue(), QScriptCompleteExpressionJob::handleResponse(), QScriptToolTipJob::handleResponse(), QScriptDebuggerLocalsModelPrivate::isTopLevelNode(), and QScriptDebuggerLocalsModel::sync().

138 {
140  return d->result;
141 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ resultAsBreakpointData()

QScriptBreakpointData QScriptDebuggerResponse::resultAsBreakpointData ( ) const

Definition at line 231 of file qscriptdebuggerresponse.cpp.

232 {
234  return qvariant_cast<QScriptBreakpointData>(d->result);
235 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsBreakpoints()

QScriptBreakpointMap QScriptDebuggerResponse::resultAsBreakpoints ( ) const

Definition at line 237 of file qscriptdebuggerresponse.cpp.

238 {
240  return qvariant_cast<QScriptBreakpointMap>(d->result);
241 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsContextInfo()

QScriptContextInfo QScriptDebuggerResponse::resultAsContextInfo ( ) const

Definition at line 273 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerPrivate::createLocalsModel().

274 {
276  return qvariant_cast<QScriptContextInfo>(d->result);
277 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptContextInfo class provides additional information about a QScriptContext.
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsInt()

int QScriptDebuggerResponse::resultAsInt ( ) const

Definition at line 213 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerPrivate::createLocalsModel(), QScriptDebuggerPrivate::handleResponse(), and QScriptDebuggerLocalsModelPrivate::isTopLevelNode().

214 {
216  return d->result.toInt();
217 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ resultAsLongLong()

qint64 QScriptDebuggerResponse::resultAsLongLong ( ) const

Definition at line 219 of file qscriptdebuggerresponse.cpp.

220 {
222  return d->result.toLongLong();
223 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ resultAsScriptData()

QScriptScriptData QScriptDebuggerResponse::resultAsScriptData ( ) const

Definition at line 249 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerShowLineJob::handleResponse().

250 {
252  return qvariant_cast<QScriptScriptData>(d->result);
253 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptScriptData class holds data associated with a script.
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsScripts()

QScriptScriptMap QScriptDebuggerResponse::resultAsScripts ( ) const

Definition at line 243 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptCompleteScriptsJob::handleResponse().

244 {
246  return qvariant_cast<QScriptScriptMap>(d->result);
247 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsScriptValue()

QScriptDebuggerValue QScriptDebuggerResponse::resultAsScriptValue ( ) const

Definition at line 255 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerLocalsModelPrivate::addTopLevelObject(), and QScriptDebuggerLocalsModel::init().

256 {
258  return qvariant_cast<QScriptDebuggerValue>(d->result);
259 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptDebuggerValue class represents a script value.
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsScriptValueList()

QScriptDebuggerValueList QScriptDebuggerResponse::resultAsScriptValueList ( ) const

Definition at line 261 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerLocalsModelPrivate::addTopLevelObject(), and QScriptDebuggerLocalsModel::init().

262 {
264  return qvariant_cast<QScriptDebuggerValueList>(d->result);
265 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ resultAsScriptValuePropertyList()

QScriptDebuggerValuePropertyList QScriptDebuggerResponse::resultAsScriptValuePropertyList ( ) const

Definition at line 267 of file qscriptdebuggerresponse.cpp.

268 {
271 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ resultAsString()

QString QScriptDebuggerResponse::resultAsString ( ) const

Definition at line 225 of file qscriptdebuggerresponse.cpp.

226 {
228  return d->result.toString();
229 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setAsync()

void QScriptDebuggerResponse::setAsync ( bool  async)

Definition at line 285 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerCommandExecutor::execute().

286 {
288  d->async = async;
289 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setError()

void QScriptDebuggerResponse::setError ( Error  error)

Sets the error code of this response.

Definition at line 127 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerCommandExecutor::execute().

128 {
130  d->error = error;
131 }
double d
Definition: qnumeric_p.h:62
Error error() const
Returns the error code of this response.
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setResult() [1/11]

void QScriptDebuggerResponse::setResult ( const QVariant value)

Sets the Result attribute of this response to the given value.

This function is provided for convenience.

Definition at line 147 of file qscriptdebuggerresponse.cpp.

Referenced by QScriptDebuggerCommandExecutor::execute().

148 {
150  d->result = value;
151 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setResult() [2/11]

void QScriptDebuggerResponse::setResult ( int  value)

Definition at line 153 of file qscriptdebuggerresponse.cpp.

154 {
156  d->result = value;
157 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setResult() [3/11]

void QScriptDebuggerResponse::setResult ( const QString value)

Definition at line 159 of file qscriptdebuggerresponse.cpp.

160 {
162  d->result = value;
163 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setResult() [4/11]

void QScriptDebuggerResponse::setResult ( const QScriptBreakpointData data)

Definition at line 165 of file qscriptdebuggerresponse.cpp.

166 {
168  d->result = QVariant::fromValue(data);
169 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [5/11]

void QScriptDebuggerResponse::setResult ( const QScriptBreakpointMap breakpoints)

Definition at line 171 of file qscriptdebuggerresponse.cpp.

172 {
174  d->result = QVariant::fromValue(breakpoints);
175 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [6/11]

void QScriptDebuggerResponse::setResult ( const QScriptScriptMap scripts)

Definition at line 177 of file qscriptdebuggerresponse.cpp.

178 {
180  d->result = QVariant::fromValue(scripts);
181 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [7/11]

void QScriptDebuggerResponse::setResult ( const QScriptScriptData data)

Definition at line 183 of file qscriptdebuggerresponse.cpp.

184 {
186  d->result = QVariant::fromValue(data);
187 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [8/11]

void QScriptDebuggerResponse::setResult ( const QScriptDebuggerValue value)

Definition at line 189 of file qscriptdebuggerresponse.cpp.

190 {
192  d->result = QVariant::fromValue(value);
193 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [9/11]

void QScriptDebuggerResponse::setResult ( const QScriptDebuggerValueList value)

Definition at line 195 of file qscriptdebuggerresponse.cpp.

196 {
198  d->result = QVariant::fromValue(values);
199 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 values[128]
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [10/11]

void QScriptDebuggerResponse::setResult ( const QScriptDebuggerValuePropertyList props)

Definition at line 201 of file qscriptdebuggerresponse.cpp.

202 {
204  d->result = QVariant::fromValue(props);
205 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ setResult() [11/11]

void QScriptDebuggerResponse::setResult ( const QScriptContextInfo info)

Definition at line 207 of file qscriptdebuggerresponse.cpp.

208 {
210  d->result = QVariant::fromValue(info);
211 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerResponse class represents a front-end&#39;s response to a QScriptDebuggerCommand.
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

Friends and Related Functions

◆ operator<<

QDataStream & operator<< ( QDataStream out,
const QScriptDebuggerResponse response 
)
friend

Writes the given response to the specified stream.

Definition at line 326 of file qscriptdebuggerresponse.cpp.

327 {
328  const QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
329  out << (quint32)d->error;
330  out << d->result;
331  out << d->async;
332  return out;
333 }
double d
Definition: qnumeric_p.h:62
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QScriptDebuggerResponsePrivate > d_ptr
QScriptDebuggerResponse::Error error
unsigned int quint32
Definition: qglobal.h:938

◆ operator>>

QDataStream & operator>> ( QDataStream in,
QScriptDebuggerResponse response 
)
friend

Reads a QScriptDebuggerResponse from the specified stream into the given response.

Definition at line 345 of file qscriptdebuggerresponse.cpp.

346 {
348 
349  quint32 error;
350  in >> error;
352  in >> d->result;
353  in >> d->async;
354 
355  return in;
356 }
double d
Definition: qnumeric_p.h:62
Error error() const
Returns the error code of this response.
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QScriptDebuggerResponsePrivate > d_ptr
QScriptDebuggerResponse::Error error
unsigned int quint32
Definition: qglobal.h:938

Properties

◆ d_ptr

QScopedPointer<QScriptDebuggerResponsePrivate> QScriptDebuggerResponse::d_ptr
private

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