~ubuntu-branches/ubuntu/quantal/qgis/quantal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/***************************************************************************
    qgsfield.cpp - Describes a field in a layer or table
     --------------------------------------
    Date                 : 01-Jan-2004
    Copyright            : (C) 2004 by Gary E.Sherman
    email                : sherman at mrcc.com
    
 ***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
/* $Id: qgsfield.cpp,v 1.6.6.1 2005/07/23 03:22:18 timlinux Exp $ */

#include <iostream>
#include "qgsfield.h"

#include <qstring.h>


static const char * const ident_ = 
   "$Id: qgsfield.cpp,v 1.6.6.1 2005/07/23 03:22:18 timlinux Exp $";


QgsField::QgsField(QString nam, QString typ, int len, int prec)
    :mName(nam), mType(typ), mLength(len), mPrecision(prec)
{
  // lower case the field name since some stores use upper case 
  // (eg. shapefiles)
  mName = mName.lower();
}

QgsField::~QgsField()
{
}

QString const & QgsField::name() const
{
  return mName;
}

QString const & QgsField::type() const
{
  return mType;
}

int QgsField::length() const
{
  return mLength;
}

int QgsField::precision() const
{
  return mPrecision;
}

void QgsField::setName(QString const & nam)
{
  mName = nam;
}

void QgsField::setType(QString const & typ)
{
  mType = typ;
}
void QgsField::setLength(int len)
{
  mLength = len;
}
void QgsField::setPrecision(int prec)
{
  mPrecision = prec;
}