# class Field | Representation of a field object. More...
Full name | `KDB::Field`
Definition | `#include <field.h>`
Inherits | KDB::Object [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- ~Field ()
- void setPrecision (unsigned int size)
- unsigned int precision ()
- void setSize (unsigned int size)
- unsigned int size ()
- void setType (DataType t)
- DataType type ()
- void setNativeType (const QString &type)
- QString nativeType ()
- void setDefaultValue (const Value &val)
- Value defaultValue ()
- void setComment (const QString &val)
- QString comment ()
- void setConstraint (const QString &val)
- QString constraint ()
- void setAcceptNull (bool)
- bool acceptNull ()
- bool isNull ()
- Value value ()
- void setValue (const Value &v, bool init = false)
- Field & operator = (const Value &v)
- Value * operator -> ()
- bool changed ()

## Detailed Description

Representation of a field object.

It knows its name, its datatype, constraints when available (like null/not null) and, when it is part of a record, its value.

The field object can manage only the data type of the underlying column. Conversion operators are provided for all common C++ datatypes. If a conversion is not allowed, a KDB::ConversionException is raised.

It is responsibility of the plugin to instantiate a correct field object for the underlying datatype. For datatypes not supported natively by C++, the Plugin can handle either QStrings or QByteArrays.

The datatype supported are the following:

- QString (can be used for unknown datatypes)
- QStringList (for sets and one-dimensional array)
- QDateTime
- QByteArray (for BLOBs and Unknown datatypes)
- char
- short
- int
- long
- float
- double
- long double
- bool

All numeric types are handled both in signed and unsigned form.

~Field () | ### ~Field

void setPrecision (unsigned int size) | ### setPrecision

unsigned int precision () | ### precision

void setSize (unsigned int size) | ### setSize

unsigned int size () | ### size

void setType (DataType t) | ### setType

DataType type () | ### type

void setNativeType (const QString &type) | ### setNativeType

QString nativeType () | ### nativeType

void setDefaultValue (const Value &val) | ### setDefaultValue

Value defaultValue () | ### defaultValue

void setComment (const QString &val) | ### setComment

QString comment () | ### comment

void setConstraint (const QString &val) | ### setConstraint

QString constraint () | ### constraint

void setAcceptNull (bool) | ### setAcceptNull

bool acceptNull () | ### acceptNull

bool isNull () | ### isNull

Value value () | ### value

void setValue (const Value &v, bool init = false) | ### setValue

Field & operator = (const Value &v) | ### operator =

Value * operator -> () | ### operator ->

bool changed () | ### changed

- Version: kdbcore 0.0.2
- Author: Alessandro Praduroux <pradu@thekompany.com>
- Generated: root@sparc.ports.openbsd.org on Wed May 2 09:48:14 2001, using kdoc 2.0a53.