00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "qgsfield.h"
00019
00020 static const char * const ident_ =
00021 "$Id$";
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 QgsField::QgsField( QString name, QVariant::Type type, QString typeName, int len, int prec, QString comment )
00037 : mName( name ), mType( type ), mTypeName( typeName ),
00038 mLength( len ), mPrecision( prec ), mComment( comment )
00039 {
00040 }
00041
00042
00043 QgsField::~QgsField()
00044 {
00045 }
00046
00047 bool QgsField::operator==( const QgsField& other ) const
00048 {
00049 return (( mName == other.mName ) && ( mType == other.mType ) && ( mTypeName == other.mTypeName )
00050 && ( mLength == other.mLength ) && ( mPrecision == other.mPrecision ) );
00051 }
00052
00053 const QString & QgsField::name() const
00054 {
00055 return mName;
00056 }
00057
00058 QVariant::Type QgsField::type() const
00059 {
00060 return mType;
00061 }
00062
00063 const QString & QgsField::typeName() const
00064 {
00065 return mTypeName;
00066 }
00067
00068 int QgsField::length() const
00069 {
00070 return mLength;
00071 }
00072
00073 int QgsField::precision() const
00074 {
00075 return mPrecision;
00076 }
00077
00078 const QString & QgsField::comment() const
00079 {
00080 return mComment;
00081 }
00082
00083 void QgsField::setName( const QString & nam )
00084 {
00085 mName = nam;
00086 }
00087
00088 void QgsField::setType( QVariant::Type type )
00089 {
00090 mType = type;
00091 }
00092
00093 void QgsField::setTypeName( const QString & typeName )
00094 {
00095 mTypeName = typeName;
00096 }
00097
00098 void QgsField::setLength( int len )
00099 {
00100 mLength = len;
00101 }
00102 void QgsField::setPrecision( int prec )
00103 {
00104 mPrecision = prec;
00105 }
00106
00107 void QgsField::setComment( const QString & comment )
00108 {
00109 mComment = comment;
00110 }