Qt 4.8
Classes | Functions
qscriptdebuggercommand_p.h File Reference
#include <QtCore/qobjectdefs.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>

Go to the source code of this file.

Classes

class  QScriptDebuggerCommand
 The QScriptDebuggerCommand class represents a command issued to a QScriptDebuggerFrontend. More...
 

Functions

Q_AUTOTEST_EXPORT QDataStreamoperator<< (QDataStream &, const QScriptDebuggerCommand &)
 
Q_AUTOTEST_EXPORT QDataStreamoperator>> (QDataStream &, QScriptDebuggerCommand &)
 

Function Documentation

◆ operator<<()

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
#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
QScriptDebuggerCommand::Type type

◆ operator>>()

Definition at line 695 of file qscriptdebuggercommand.cpp.

696 {
697  QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
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
QHash< QScriptDebuggerCommand::Attribute, QVariant > attributes
int key
unsigned int quint32
Definition: qglobal.h:938
QScriptDebuggerCommand::Type type