Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

fbwrap::FBwField Class Reference

Base class for all kind of fields. More...

#include <FBwField.h>

Inheritance diagram for fbwrap::FBwField:

fbwrap::FBwBlobField fbwrap::FBwDateField fbwrap::FBwDateTimeField fbwrap::FBwIntegerField fbwrap::FBwLongIntegerField fbwrap::FBwNumField fbwrap::FBwShortField fbwrap::FBwStringField fbwrap::FBwTimeField List of all members.

Public Methods

 FBwField (string pname, FBwFieldKind pKind)
 Field Constructor.

 FBwField (const FBwField &f)
 Field copy constructor.

 FBwField (const FBwField &f, FBwFieldKind pKind)
 Field copy constructor with kind info.

virtual string AsString () const
 get the value as string without formating

virtual std::ostream & DisplayText (std::ostream &o) const
 Put on a stream as a formated string.

void SetName (const string &s)
 Sets field name to s.

string Name () const
 < Get field name

virtual bool IsNumeric () const
 Check if field is numeric.

virtual bool IsDate () const
 < Check if field is Date

bool HasNull () const
 < Check if field can be NULL

bool IsNull () const
 < Checks if value is NULL

virtual double AsDouble () const
 Get field value as double.

virtual short AsShort () const
 Get field value as short.

virtual long AsInteger () const
virtual long long int AsLongInteger () const
virtual FBwDate AsDate () const
 Get field value as FBwDate.

virtual FBwTime AsTime () const
 Get field value as FBwTime.

virtual FBwDateTime AsDateTime () const
 Get field value as FBwDateTime.

virtual void SetAsString (const string &val)
 Set field value from string.

virtual void SetAsDouble (double val)
 Set field value from double.

virtual void SetAsShort (short val)
 Set field value from short.

virtual void SetAsDate (const FBwDate &d)
 Set field value from FBwDate.

virtual void SetAsTime (const FBwTime &d)
 Set field value from FBwTime.

virtual void SetAsDateTime (const FBwDateTime &d)
 Set field value from FBwDateTime.

virtual void SetAsInteger (long val)
 Set field value from long int.

virtual void SetAsLongInteger (long long int val)
 Set field value from long long int.

void SetNull ()
 Flag field as NULL.

void ClearNull ()
 Flag field as not null.

virtual void ConvertStoV ()
 Convert from internal representation to c++ type value.

virtual void ConvertVtoS ()
short GetLen () const
void SetLen (short len)
 Set Field Length.

virtual void SetFormat (string fmt)
 Set display format for field.

virtual void SetScale (short scal)
 Set Field scale.

short GetScale () const
 Get field scale.

FBwFieldKind FieldKind () const
 Get Field Type.

virtual void ValueCopy (const FBwField *fld)
 Copy the value of fld.

virtual FBwField * Clone () const
 < Get a field with same underliyng type

void SetAsigned (bool how=true)
 Flags field as assigned or not depending on parameter how.

bool IsAsigned () const
 Tests if field is assigned.

virtual ~FBwField ()
 Destructor.


Protected Methods

virtual void * GetPtr ()
virtual void BindPtr (char **p)
 Method for binding to XSQLVAR.

virtual void BindNullPtr (short **p)
virtual void bCopy (const FBwField *f)
void LeftTrim (string &s)
virtual int ByteSize () const
 size of type


Protected Attributes

short nullvalue
short scale
short sqltype
short sqllen
short subtype
bool hasnull
 true if field can be NULL

bool asigned
string dspformat

Friends

class FieldList

Detailed Description

Base class for all kind of fields.


Constructor & Destructor Documentation

fbwrap::FBwField::FBwField string    pname,
FBwFieldKind    pKind
 

Field Constructor.

Parameters:
pname:  Field name
pKind:  Field Type


Member Function Documentation

long fbwrap::FBwField::AsInteger   const [virtual]
 

Get field values as int Get field value as long long int (int64)

Reimplemented in fbwrap::FBwShortField, fbwrap::FBwLongIntegerField, fbwrap::FBwIntegerField, fbwrap::FBwFloatField, fbwrap::FBwDoubleField, fbwrap::FBwExact32, and fbwrap::FBwStringField.

virtual int fbwrap::FBwField::ByteSize   const [inline, protected, virtual]
 

size of type

size in bytes of a buffer capable of holding an internal representation of this field

Reimplemented in fbwrap::FBwBlobField, fbwrap::FBwDateField, fbwrap::FBwShortField, fbwrap::FBwLongIntegerField, and fbwrap::FBwIntegerField.

virtual std::ostream& fbwrap::FBwField::DisplayText std::ostream &    o const [inline, virtual]
 

Put on a stream as a formated string.

Parameters:
o:  output stream

Reimplemented in fbwrap::FBwDateField, fbwrap::FBwDateTimeField, fbwrap::FBwShortField, fbwrap::FBwIntegerField, fbwrap::FBwFloatField, fbwrap::FBwDoubleField, fbwrap::FBwExact32, fbwrap::FBwStringField, and fbwrap::FBwTimeField.

virtual void fbwrap::FBwField::ValueCopy const FBwField *    fld [inline, virtual]
 

Copy the value of fld.

type casts are made if posible


Member Data Documentation

bool fbwrap::FBwField::asigned [protected]
 

true if some value was assigned to the field This needed to assign to sqldata in XSQLVAR


The documentation for this class was generated from the following files:
Generated on Fri Jan 31 08:30:04 2003 for fbwrap by doxygen1.2.17