Qt 4.8
Classes | Functions
qscriptdebuggercommand.cpp File Reference
#include "qscriptdebuggercommand_p.h"
#include "qscriptbreakpointdata_p.h"
#include "qscriptdebuggervalue_p.h"
#include <QtCore/qhash.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qstringlist.h>

Go to the source code of this file.

Classes

class  QScriptDebuggerCommandPrivate
 

Functions

QDataStreamoperator<< (QDataStream &out, const QScriptDebuggerCommand &command)
 
QDataStreamoperator>> (QDataStream &in, QScriptDebuggerCommand &command)
 

Function Documentation

◆ operator<<()

QDataStream& operator<< ( QDataStream out,
const QScriptDebuggerCommand command 
)

Definition at line 672 of file qscriptdebuggercommand.cpp.

673 {
674  const QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
675  out << (quint32)d->type;
676  out << (qint32)d->attributes.size();
678  for (it = d->attributes.constBegin(); it != d->attributes.constEnd(); ++it) {
679  out << (quint32)it.key();
680  out << it.value();
681  }
682  return out;
683 }
double d
Definition: qnumeric_p.h:62
int qint32
Definition: qglobal.h:937
T * data() const
Returns the value of the pointer referenced by this object.
#define it(className, varName)
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QHash< QScriptDebuggerCommand::Attribute, QVariant > attributes
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
int size() const
Returns the number of items in the hash.
Definition: qhash.h:295
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
unsigned int quint32
Definition: qglobal.h:938
QScopedPointer< QScriptDebuggerCommandPrivate > d_ptr
QScriptDebuggerCommand::Type type

◆ operator>>()

QDataStream& operator>> ( QDataStream in,
QScriptDebuggerCommand command 
)

Definition at line 695 of file qscriptdebuggercommand.cpp.

696 {
698 
699  quint32 type;
700  in >> type;
702 
703  qint32 attribCount;
704  in >> attribCount;
706  for (qint32 i = 0; i < attribCount; ++i) {
707  quint32 key;
708  in >> key;
709  QVariant value;
710  in >> value;
711  attribs[QScriptDebuggerCommand::Attribute(key)] = value;
712  }
713  d->attributes = attribs;
714 
715  return in;
716 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
double d
Definition: qnumeric_p.h:62
int type
Definition: qmetatype.cpp:239
int qint32
Definition: qglobal.h:937
T * data() const
Returns the value of the pointer referenced by this object.
QHash< QScriptDebuggerCommand::Attribute, QVariant > attributes
int key
unsigned int quint32
Definition: qglobal.h:938
QScopedPointer< QScriptDebuggerCommandPrivate > d_ptr
QScriptDebuggerCommand::Type type