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

« back to all changes in this revision

Viewing changes to src/qgsfield.cpp

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
    qgsfield.cpp - Describes a field in a layer or table
3
 
     --------------------------------------
4
 
    Date                 : 01-Jan-2004
5
 
    Copyright            : (C) 2004 by Gary E.Sherman
6
 
    email                : sherman at mrcc.com
7
 
    
8
 
 ***************************************************************************
9
 
 *                                                                         *
10
 
 *   This program is free software; you can redistribute it and/or modify  *
11
 
 *   it under the terms of the GNU General Public License as published by  *
12
 
 *   the Free Software Foundation; either version 2 of the License, or     *
13
 
 *   (at your option) any later version.                                   *
14
 
 *                                                                         *
15
 
 ***************************************************************************/
16
 
/* $Id: qgsfield.cpp,v 1.6.6.1 2005/07/23 03:22:18 timlinux Exp $ */
17
 
 
18
 
#include <iostream>
19
 
#include "qgsfield.h"
20
 
 
21
 
#include <qstring.h>
22
 
 
23
 
 
24
 
static const char * const ident_ = 
25
 
   "$Id: qgsfield.cpp,v 1.6.6.1 2005/07/23 03:22:18 timlinux Exp $";
26
 
 
27
 
 
28
 
QgsField::QgsField(QString nam, QString typ, int len, int prec)
29
 
    :mName(nam), mType(typ), mLength(len), mPrecision(prec)
30
 
{
31
 
  // lower case the field name since some stores use upper case 
32
 
  // (eg. shapefiles)
33
 
  mName = mName.lower();
34
 
}
35
 
 
36
 
QgsField::~QgsField()
37
 
{
38
 
}
39
 
 
40
 
QString const & QgsField::name() const
41
 
{
42
 
  return mName;
43
 
}
44
 
 
45
 
QString const & QgsField::type() const
46
 
{
47
 
  return mType;
48
 
}
49
 
 
50
 
int QgsField::length() const
51
 
{
52
 
  return mLength;
53
 
}
54
 
 
55
 
int QgsField::precision() const
56
 
{
57
 
  return mPrecision;
58
 
}
59
 
 
60
 
void QgsField::setName(QString const & nam)
61
 
{
62
 
  mName = nam;
63
 
}
64
 
 
65
 
void QgsField::setType(QString const & typ)
66
 
{
67
 
  mType = typ;
68
 
}
69
 
void QgsField::setLength(int len)
70
 
{
71
 
  mLength = len;
72
 
}
73
 
void QgsField::setPrecision(int prec)
74
 
{
75
 
  mPrecision = prec;
76
 
}