Quantum GIS API Documentation
1.7.4
|
00001 /*************************************************************************** 00002 qgsfield.h - Describes a field in a layer or table 00003 -------------------------------------- 00004 Date : 01-Jan-2004 00005 Copyright : (C) 2004 by Gary E.Sherman 00006 email : sherman at mrcc.com 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 /* $Id$ */ 00016 00017 #ifndef QGSFIELD_H 00018 #define QGSFIELD_H 00019 00020 #include <QString> 00021 #include <QVariant> 00022 00029 class CORE_EXPORT QgsField 00030 { 00031 public: 00044 QgsField( QString name = QString(), 00045 QVariant::Type type = QVariant::Invalid, 00046 QString typeName = QString(), 00047 int len = 0, 00048 int prec = 0, 00049 QString comment = QString() ); 00050 00052 ~QgsField(); 00053 00054 bool operator==( const QgsField& other ) const; 00055 00057 const QString & name() const; 00058 00060 QVariant::Type type() const; 00061 00068 const QString & typeName() const; 00069 00070 00075 int length() const; 00076 00077 00082 int precision() const; 00083 00087 const QString & comment() const; 00088 00093 void setName( const QString & nam ); 00094 00098 void setType( QVariant::Type type ); 00099 00104 void setTypeName( const QString & typ ); 00105 00110 void setLength( int len ); 00111 00116 void setPrecision( int prec ); 00117 00118 00122 void setComment( const QString & comment ); 00123 00124 private: 00125 00127 QString mName; 00128 00130 QVariant::Type mType; 00131 00133 QString mTypeName; 00134 00136 int mLength; 00137 00139 int mPrecision; 00140 00142 QString mComment; 00143 00144 }; // class QgsField 00145 00146 // key = field index, value=field data 00147 typedef QMap<int, QgsField> QgsFieldMap; 00148 00149 #endif