QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsfield_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfield_p.h
3  ------------
4  Date : May 2015
5  Copyright : (C) 2015 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSFIELD_PRIVATE_H
17 #define QGSFIELD_PRIVATE_H
18 
20 
21 //
22 // W A R N I N G
23 // -------------
24 //
25 // This file is not part of the QGIS API. It exists purely as an
26 // implementation detail. This header file may change from version to
27 // version without notice, or even be removed.
28 //
29 
30 #include <QString>
31 #include <QVariant>
32 #include <QSharedData>
33 #include "qgsfield.h"
34 
35 class QgsFieldPrivate : public QSharedData
36 {
37  public:
38 
39  QgsFieldPrivate( QString name = QString(),
40  QVariant::Type type = QVariant::Invalid,
41  QString typeName = QString(),
42  int len = 0,
43  int prec = 0,
44  QString comment = QString() )
45  : name( name )
46  , type( type )
47  , typeName( typeName )
48  , length( len )
49  , precision( prec )
50  , comment( comment )
51  {
52  }
53 
54  QgsFieldPrivate( const QgsFieldPrivate& other )
55  : QSharedData( other )
56  , name( other.name )
57  , type( other.type )
58  , typeName( other.typeName )
59  , length( other.length )
60  , precision( other.precision )
61  , comment( other.comment )
62  {
63  }
64 
65  ~QgsFieldPrivate() {}
66 
67  bool operator==( const QgsFieldPrivate& other ) const
68  {
69  return (( name == other.name ) && ( type == other.type )
70  && ( length == other.length ) && ( precision == other.precision ) );
71  }
72 
74  QString name;
75 
77  QVariant::Type type;
78 
80  QString typeName;
81 
83  int length;
84 
86  int precision;
87 
89  QString comment;
90 };
91 
92 
93 class CORE_EXPORT QgsFieldsPrivate : public QSharedData
94 {
95  public:
96 
97  QgsFieldsPrivate()
98  {
99  }
100 
101  QgsFieldsPrivate( const QgsFieldsPrivate& other )
102  : QSharedData( other )
103  , fields( other.fields )
104  , nameToIndex( other.nameToIndex )
105  {
106  }
107 
108  ~QgsFieldsPrivate() {}
109 
112 
114  QHash<QString, int> nameToIndex;
115 
116 };
117 
119 
120 #endif
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)