22
22
#include < QDataStream>
23
23
#include < QtCore/qmath.h>
24
24
25
+ /* **************************************************************************
26
+ * This class is considered CRITICAL and any change MUST be accompanied with
27
+ * full unit tests in testqgsfield.cpp.
28
+ * See details in QEP #17
29
+ ****************************************************************************/
25
30
26
31
#if 0
27
32
QgsField::QgsField( QString nam, QString typ, int len, int prec, bool num,
@@ -48,13 +53,18 @@ QgsField::QgsField( const QgsField &other )
48
53
49
54
}
50
55
56
+ /* **************************************************************************
57
+ * This class is considered CRITICAL and any change MUST be accompanied with
58
+ * full unit tests in testqgsfield.cpp.
59
+ * See details in QEP #17
60
+ ****************************************************************************/
61
+
51
62
QgsField &QgsField::operator =( const QgsField & other )
52
63
{
53
64
d = other.d ;
54
65
return *this ;
55
66
}
56
67
57
-
58
68
QgsField::~QgsField ()
59
69
{
60
70
}
@@ -99,6 +109,12 @@ QString QgsField::comment() const
99
109
return d->comment ;
100
110
}
101
111
112
+ /* **************************************************************************
113
+ * This class is considered CRITICAL and any change MUST be accompanied with
114
+ * full unit tests in testqgsfield.cpp.
115
+ * See details in QEP #17
116
+ ****************************************************************************/
117
+
102
118
void QgsField::setName ( const QString& name )
103
119
{
104
120
d->name = name;
@@ -128,6 +144,12 @@ void QgsField::setComment( const QString& comment )
128
144
d->comment = comment;
129
145
}
130
146
147
+ /* **************************************************************************
148
+ * This class is considered CRITICAL and any change MUST be accompanied with
149
+ * full unit tests in testqgsfield.cpp.
150
+ * See details in QEP #17
151
+ ****************************************************************************/
152
+
131
153
QString QgsField::displayString ( const QVariant& v ) const
132
154
{
133
155
if ( v.isNull () )
@@ -142,6 +164,12 @@ QString QgsField::displayString( const QVariant& v ) const
142
164
return v.toString ();
143
165
}
144
166
167
+ /* **************************************************************************
168
+ * This class is considered CRITICAL and any change MUST be accompanied with
169
+ * full unit tests in testqgsfield.cpp.
170
+ * See details in QEP #17
171
+ ****************************************************************************/
172
+
145
173
bool QgsField::convertCompatible ( QVariant& v ) const
146
174
{
147
175
if ( v.isNull () )
@@ -203,6 +231,11 @@ bool QgsField::convertCompatible( QVariant& v ) const
203
231
return true ;
204
232
}
205
233
234
+ /* **************************************************************************
235
+ * This class is considered CRITICAL and any change MUST be accompanied with
236
+ * full unit tests in testqgsfield.cpp.
237
+ * See details in QEP #17
238
+ ****************************************************************************/
206
239
207
240
QDataStream& operator <<( QDataStream& out, const QgsField& field )
208
241
{
@@ -231,6 +264,13 @@ QDataStream& operator>>( QDataStream& in, QgsField& field )
231
264
232
265
// //////////////////////////////////////////////////////////////////////////
233
266
267
+
268
+ /* **************************************************************************
269
+ * This class is considered CRITICAL and any change MUST be accompanied with
270
+ * full unit tests in testqgsfields.cpp.
271
+ * See details in QEP #17
272
+ ****************************************************************************/
273
+
234
274
QgsFields::QgsFields ()
235
275
{
236
276
d = new QgsFieldsPrivate ( );
@@ -258,6 +298,12 @@ void QgsFields::clear()
258
298
d->nameToIndex .clear ();
259
299
}
260
300
301
+ /* **************************************************************************
302
+ * This class is considered CRITICAL and any change MUST be accompanied with
303
+ * full unit tests in testqgsfields.cpp.
304
+ * See details in QEP #17
305
+ ****************************************************************************/
306
+
261
307
bool QgsFields::append ( const QgsField& field, FieldOrigin origin, int originIndex )
262
308
{
263
309
if ( d->nameToIndex .contains ( field.name () ) )
@@ -303,6 +349,12 @@ void QgsFields::extend( const QgsFields& other )
303
349
}
304
350
}
305
351
352
+ /* **************************************************************************
353
+ * This class is considered CRITICAL and any change MUST be accompanied with
354
+ * full unit tests in testqgsfields.cpp.
355
+ * See details in QEP #17
356
+ ****************************************************************************/
357
+
306
358
bool QgsFields::isEmpty () const
307
359
{
308
360
return d->fields .isEmpty ();
@@ -343,6 +395,12 @@ const QgsField &QgsFields::field( const QString &name ) const
343
395
return d->fields [ indexFromName ( name )].field ;
344
396
}
345
397
398
+ /* **************************************************************************
399
+ * This class is considered CRITICAL and any change MUST be accompanied with
400
+ * full unit tests in testqgsfields.cpp.
401
+ * See details in QEP #17
402
+ ****************************************************************************/
403
+
346
404
const QgsField &QgsFields::operator []( int i ) const
347
405
{
348
406
return d->fields [i].field ;
@@ -379,6 +437,12 @@ bool QgsFields::operator==( const QgsFields &other ) const
379
437
return d->fields == other.d ->fields ;
380
438
}
381
439
440
+ /* **************************************************************************
441
+ * This class is considered CRITICAL and any change MUST be accompanied with
442
+ * full unit tests in testqgsfields.cpp.
443
+ * See details in QEP #17
444
+ ****************************************************************************/
445
+
382
446
int QgsFields::fieldNameIndex ( const QString& fieldName ) const
383
447
{
384
448
for ( int idx = 0 ; idx < count (); ++idx )
@@ -404,6 +468,12 @@ QgsAttributeList QgsFields::allAttributesList() const
404
468
return lst;
405
469
}
406
470
471
+ /* **************************************************************************
472
+ * This class is considered CRITICAL and any change MUST be accompanied with
473
+ * full unit tests in testqgsfields.cpp.
474
+ * See details in QEP #17
475
+ ****************************************************************************/
476
+
407
477
QDataStream& operator <<( QDataStream& out, const QgsFields& fields )
408
478
{
409
479
out << ( quint32 )fields.size ();
0 commit comments