Qt 4.8
qscriptdebuggervalueproperty.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtSCriptTools module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
43 #include "qscriptdebuggervalue_p.h"
45 
46 #include <QtCore/qatomic.h>
47 #include <QtCore/qdatastream.h>
48 #include <QtCore/qstring.h>
49 
51 
58 {
59 public:
62 
67 
69 };
70 
72 {
73  ref = 0;
74 }
75 
77 {
78 }
79 
84  : d_ptr(0)
85 {
86 }
87 
94  const QString &valueAsString,
97 {
98  d_ptr->name = name;
99  d_ptr->value = value;
100  d_ptr->valueAsString = valueAsString;
101  d_ptr->flags = flags;
102  d_ptr->ref.ref();
103 }
104 
109  : d_ptr(other.d_ptr.data())
110 {
111  if (d_ptr)
112  d_ptr->ref.ref();
113 }
114 
119 {
120 }
121 
126 {
127  d_ptr.assign(other.d_ptr.data());
128  return *this;
129 }
130 
135 {
137  if (!d)
138  return QString();
139  return d->name;
140 }
141 
146 {
148  if (!d)
149  return QScriptDebuggerValue();
150  return d->value;
151 }
152 
154 {
156  if (!d)
157  return QString();
158  return d->valueAsString;
159 }
160 
165 {
167  if (!d)
168  return 0;
169  return d->flags;
170 }
171 
177 {
179  return (d != 0);
180 }
181 
192 {
193  out << property.name();
194  out << property.value();
195  out << property.valueAsString();
196  out << (quint32)property.flags();
197  return out;
198 }
199 
211 {
212  QString name;
215  quint32 flags;
216  in >> name;
217  in >> value;
218  in >> valueAsString;
219  in >> flags;
220  property = QScriptDebuggerValueProperty(
221  name, value, valueAsString, QScriptValue::PropertyFlags(flags));
222  return in;
223 }
224 
226 {
227  out << delta.removedProperties;
228  out << delta.changedProperties;
229  out << delta.addedProperties;
230  return out;
231 }
232 
234 {
235  in >> delta.removedProperties;
236  in >> delta.changedProperties;
237  in >> delta.addedProperties;
238  return in;
239 }
240 
double d
Definition: qnumeric_p.h:62
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QDataStream & operator>>(QDataStream &stream, QScriptDebuggerValueProperty &property)
Reads a QScriptDebuggerValueProperty from the specified stream into the given property.
T * data() const
Returns the value of the pointer referenced by this object.
~QScriptDebuggerValueProperty()
Destroys this QScriptDebuggerValueProperty.
QString name() const
Returns the name of this QScriptDebuggerValueProperty.
QDataStream & operator<<(QDataStream &stream, const QScriptDebuggerValueProperty &property)
Writes the given property to the specified stream.
QScriptDebuggerValue value() const
Returns the value of this QScriptDebuggerValueProperty.
QScriptDebuggerValueProperty & operator=(const QScriptDebuggerValueProperty &other)
Assigns the other property to this QScriptDebuggerValueProperty.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
bool isValid() const
Returns true if this QScriptDebuggerValueProperty is valid, otherwise returns false.
QScriptValue::PropertyFlags flags() const
Returns the flags of this QScriptDebuggerValueProperty.
QScriptDebuggerValueProperty()
Constructs an invalid QScriptDebuggerValueProperty.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QScopedSharedPointer< QScriptDebuggerValuePropertyPrivate > d_ptr
static const char * data(const QByteArray &arr)
The QScriptDebuggerValue class represents a script value.
PropertyFlags
Definition: qmetaobject_p.h:61
unsigned int quint32
Definition: qglobal.h:938
const char * property
Definition: qwizard.cpp:138
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71