Qt 4.8
Classes | Functions
qscriptscriptdata.cpp File Reference
#include "qscriptscriptdata_p.h"
#include <QtCore/qdatastream.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>

Go to the source code of this file.

Classes

class  QScriptScriptDataPrivate
 

Functions

QDataStreamoperator<< (QDataStream &out, const QScriptScriptData &data)
 
QDataStreamoperator>> (QDataStream &in, QScriptScriptData &data)
 

Function Documentation

◆ operator<<()

QDataStream& operator<< ( QDataStream out,
const QScriptScriptData data 
)

Definition at line 185 of file qscriptscriptdata.cpp.

186 {
187  const QScriptScriptDataPrivate *d = data.d_ptr.data();
188  if (d) {
189  out << d->contents;
190  out << d->fileName;
191  out << qint32(d->baseLineNumber);
192  } else {
193  out << QString();
194  out << QString();
195  out << qint32(0);
196  }
197  return out;
198 }
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.
The QString class provides a Unicode character string.
Definition: qstring.h:83
QScopedSharedPointer< QScriptScriptDataPrivate > d_ptr

◆ operator>>()

QDataStream& operator>> ( QDataStream in,
QScriptScriptData data 
)

Definition at line 200 of file qscriptscriptdata.cpp.

201 {
202  if (!data.d_ptr) {
204  data.d_ptr->ref.ref();
205  }
207  in >> d->contents;
208  in >> d->fileName;
209  qint32 ln;
210  in >> ln;
211  d->baseLineNumber = ln;
212  return in;
213 }
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.
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QScopedSharedPointer< QScriptScriptDataPrivate > d_ptr