RVC::DBTABLE::FIELDINFO Class Reference

#include <rvc/dbtable.h>

List of all members.

Public Types

enum  FLAGS {
  FLAG_None = 0x0000, FLAG_PrimaryKey = 0x0001, FLAG_PK = FLAG_PrimaryKey, FLAG_ForeignKey = 0x0002,
  FLAG_FK = FLAG_ForeignKey, FLAG_Indexed = 0x0004, FLAG_NotNULL = 0x0010, FLAG_Unique = 0x0020,
  FLAG_ReadOnly = 0x0040, FLAG_SecondaryKey = 0x0080, FLAG_SK = FLAG_SecondaryKey, FLAG_Invisible = 0x0100,
  FLAG_Closest = 0x0200, FLAG_RangeAbove = 0x0400, FLAG_RangeBelow = 0x0800, FLAG_ComputeOnRead = 0x0008,
  FLAG_ComputeOnWrite = 0x1000, FLAG_Computed = 0x1008, FLAG_LocalTime = 0x2000, FLAG_AutoIncrement = 0x4000
}
enum  NEXTFIELD { NEXTFIELD_ThisFieldName = 0xFFFF, NEXTFIELD_ThisTableName = 0xFFFE, NEXTFIELD_DomID = 0xFFFD, NEXTFIELD_PseudoField = 0xFFFC }
enum  TYPE {
  TYPE_Invalid = 0, TYPE_String = 1, TYPE_Char = 2, TYPE_UByte = 3,
  TYPE_Byte = 4, TYPE_UWord = 5, TYPE_Word = 6, TYPE_ULong = 7,
  TYPE_Long = 8, TYPE_Float = 9, TYPE_Double = 10, TYPE_Logical = 11,
  TYPE_Date = 12, TYPE_Color = 15, TYPE_Binary = 16, TYPE_Memo = 17,
  TYPE_Unicode = 18, TYPE_DateTime = 19
}
enum  USAGE {
  USAGE_Undefined = 0, USAGE_XCoord = 1, USAGE_YCoord, USAGE_ZCoord,
  USAGE_Label, USAGE_Filename, USAGE_ObjName
}

Public Member Functions

void Clear ()
TYPE CompareFieldTypes (const FIELDINFO &rhs, bool &ExactMatch) const
 FIELDINFO ()
UINT32 GetAutoIncrement () const
int GetDecimalPlaces () const
int GetDispUnits () const
int GetDispWidth () const
const RVC::OBJECTNAMEGetDomainID () const
FLAGS GetFlags () const
const RVC::OBJECTNAMEGetName () const
INT32 GetNextLinkField () const
NEXTFIELD GetPseudoNextLinkField () const
INT32 GetRelatedField () const
INT32 GetRelatedTable () const
INT32 GetSize () const
TYPE GetType () const
void GetUnits (UNITCONV &conv) const
USAGE GetUsage () const
bool HasNextKey () const
bool HasPseudoNextKey () const
bool HasRelation () const
bool IsNumeric () const
void ResetPosition ()
void SetAutoIncrement (UINT32 count)
void SetDecimalPlaces (int decplaces)
void SetDispUnits (int unit)
void SetDispWidth (int width)
void SetDomainID (const RVC::OBJECTNAME &name)
void SetFlags (FLAGS flags)
void SetLink (INT32 TableNum, INT32 FieldNum, NEXTFIELD NextFieldNum)
void SetLink (INT32 TableNum, INT32 FieldNum, INT32 NextFieldNum=-1)
void SetName (TEXTID textid)
void SetName (const RVC::OBJECTNAME &name)
void SetNextLinkField (INT32 NextFieldNum)
void SetSize (INT32 size)
void SetType (TYPE type)
void SetUnits (const UNITCONV &conv)
void SetUsage (USAGE usage)


Member Enumeration Documentation

enum RVC::DBTABLE::FIELDINFO::FLAGS
 

Enumeration values:
FLAG_None 
FLAG_PrimaryKey  Field is a primary key (force index).
FLAG_PK 
FLAG_ForeignKey  Field is a foreign key (index optional).
FLAG_FK 
FLAG_Indexed  Field has index.
FLAG_NotNULL  Value cannot be NULL.
FLAG_Unique  value must be unique
FLAG_ReadOnly  User can't change value.
FLAG_SecondaryKey  Secondary (or higher) key.
FLAG_SK 
FLAG_Invisible  Don't show the field at all.
FLAG_Closest 
FLAG_RangeAbove 
FLAG_RangeBelow 
FLAG_ComputeOnRead  Field is computed.
FLAG_ComputeOnWrite  Compute field on write.
FLAG_Computed 
FLAG_LocalTime  TYPE_DateTime field is stored in local time.
FLAG_AutoIncrement  Assignes the "AutoIncrement" value to the field and then increments "AutoIncrement" (default start is '1').

Definition at line 1312 of file dbtable.h.

enum RVC::DBTABLE::FIELDINFO::NEXTFIELD
 

pseudo fields for FIELDINFO.next_field.

Some database schemas require a 2 part key where the primary key is made up of 2 fields but the foreign key is made up of 1 field and the name of the field or one field and a "domid" which is looked up from a 3rd table by using the table/field name. We look those up on import and record them in the FIELDINFO.domid. I don't know of anything that would use the table name, but I added it for completeness

Enumeration values:
NEXTFIELD_ThisFieldName  Name of this field is the key data.
NEXTFIELD_ThisTableName  Name of this table is the key data.
NEXTFIELD_DomID  Key data is the "domid" field of this field.
NEXTFIELD_PseudoField  If next_field is > this, it's one of these.

Definition at line 1305 of file dbtable.h.

enum RVC::DBTABLE::FIELDINFO::TYPE
 

Enumeration values:
TYPE_Invalid  Invalid field type.
TYPE_String  ASCII character string, null-terminated.
TYPE_Char  Single ASCII character.
TYPE_UByte  Unsigned 1-byte integer (0-255).
TYPE_Byte  Signed 1-byte integer (-128-128).
TYPE_UWord  Unsigned 2-byte integer (0-65535).
TYPE_Word  Signed 2-byte integer (-32768-32767).
TYPE_ULong  Unsigned 4-byte integer (0 - 2^32-1).
TYPE_Long  Signed 4-byte integer (-2^31 - 2^31-1).
TYPE_Float  4-byte floating-point number
TYPE_Double  8-byte floating-point number
TYPE_Logical  1-byte logical (?/Y/y/N/n/T/t/F/f/0/1)
TYPE_Date  4-byte integer date YYYYMMDD
TYPE_Color  Color spec. Always 8 bytes (COLOR).
TYPE_Binary  Binary field.
TYPE_Memo  Memo field.
TYPE_Unicode  UNICODE string, null-terminated.
TYPE_DateTime  Date/Time field, 100-nanosecond intervals from 1-Jan-1601.

Definition at line 1335 of file dbtable.h.

enum RVC::DBTABLE::FIELDINFO::USAGE
 

Enumeration values:
USAGE_Undefined 
USAGE_XCoord 
USAGE_YCoord 
USAGE_ZCoord 
USAGE_Label 
USAGE_Filename 
USAGE_ObjName 

Definition at line 1356 of file dbtable.h.


Constructor & Destructor Documentation

RVC::DBTABLE::FIELDINFO::FIELDINFO  )  [inline]
 

Default constructor.

Definition at line 1367 of file dbtable.h.


Member Function Documentation

void RVC::DBTABLE::FIELDINFO::Clear  )  [inline]
 

Clear the field info of current values.

Definition at line 1371 of file dbtable.h.

TYPE RVC::DBTABLE::FIELDINFO::CompareFieldTypes const FIELDINFO rhs,
bool &  ExactMatch
const
 

Compare two field types and return best field type to convert to.

Returns:
this->GetType() if exact match, TYPE_??? depending if the types are not the best match but still matchable, TYPE_Invalid if types do not match
Parameters:
ExactMatch  Set to 'true' if the two fields match exactly, 'false' if they do not

UINT32 RVC::DBTABLE::FIELDINFO::GetAutoIncrement  )  const [inline]
 

Get the AutoIncrement number for the next added record.

Returns:
Next AutoIncrement number

Definition at line 1384 of file dbtable.h.

int RVC::DBTABLE::FIELDINFO::GetDecimalPlaces  )  const [inline]
 

Get number of decimal places to display for floating point fields.

Returns:
Number of decimal places to display

Definition at line 1389 of file dbtable.h.

int RVC::DBTABLE::FIELDINFO::GetDispUnits  )  const [inline]
 

Get the display units for this field.

Returns:
Display unit

Definition at line 1394 of file dbtable.h.

int RVC::DBTABLE::FIELDINFO::GetDispWidth  )  const [inline]
 

Get number of columns to display.

Returns:
Number of columns to display

Definition at line 1399 of file dbtable.h.

const RVC::OBJECTNAME& RVC::DBTABLE::FIELDINFO::GetDomainID  )  const [inline]
 

Get the domain ID for this field.

Returns:
Domain ID

Definition at line 1404 of file dbtable.h.

FLAGS RVC::DBTABLE::FIELDINFO::GetFlags  )  const [inline]
 

Get the flags for this field.

Returns:
Field flags (FIELDINFO::FLAGS_...)

Definition at line 1409 of file dbtable.h.

const RVC::OBJECTNAME& RVC::DBTABLE::FIELDINFO::GetName  )  const [inline]
 

Get the name of this field.

Returns:
Field name

Definition at line 1414 of file dbtable.h.

INT32 RVC::DBTABLE::FIELDINFO::GetNextLinkField  )  const [inline]
 

Get the next field number that this field is linked to.

Returns:
Next link field number

Definition at line 1419 of file dbtable.h.

NEXTFIELD RVC::DBTABLE::FIELDINFO::GetPseudoNextLinkField  )  const [inline]
 

Get the next field pseudo number that this field is linked to.

Returns:
Next link field pseudo number (FIELDINFO::NEXTFIELD_...)

Definition at line 1424 of file dbtable.h.

INT32 RVC::DBTABLE::FIELDINFO::GetRelatedField  )  const [inline]
 

Get the field number that this field is linked to, use HasRelation() to determine if the field is related to another table / field.

Returns:
Linked field number

Definition at line 1430 of file dbtable.h.

INT32 RVC::DBTABLE::FIELDINFO::GetRelatedTable  )  const [inline]
 

Get the table number that this field is linked to, use HasRelation() to determine if the field is related to another table / field.

Returns:
Related table number

Definition at line 1436 of file dbtable.h.

INT32 RVC::DBTABLE::FIELDINFO::GetSize  )  const [inline]
 

Get the size of the field in bytes.

Returns:
Size of field in bytes

Definition at line 1441 of file dbtable.h.

TYPE RVC::DBTABLE::FIELDINFO::GetType  )  const [inline]
 

Get the type of the field.

Returns:
Type of field (FIELDINFO::TYPE_...)

Definition at line 1446 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::GetUnits UNITCONV conv  )  const [inline]
 

Get the numeric units for this field for unit conversion.

Definition at line 1450 of file dbtable.h.

USAGE RVC::DBTABLE::FIELDINFO::GetUsage  )  const [inline]
 

Get the usage of the field.

Returns:
Field usage (FIELDINFO::USAGE_...)

Definition at line 1456 of file dbtable.h.

bool RVC::DBTABLE::FIELDINFO::HasNextKey  )  const [inline]
 

Does the field have a next key field link?

Returns:
'True' if field has a next key field

Definition at line 1466 of file dbtable.h.

bool RVC::DBTABLE::FIELDINFO::HasPseudoNextKey  )  const [inline]
 

Does the field have a next key pseudo field link?

Returns:
'True' if field has a next pseudo key field

Definition at line 1471 of file dbtable.h.

bool RVC::DBTABLE::FIELDINFO::HasRelation  )  const [inline]
 

Is the field related to another table / field.

Returns:
'True' if field is related

Definition at line 1461 of file dbtable.h.

bool RVC::DBTABLE::FIELDINFO::IsNumeric  )  const [inline]
 

Is the field a nemeric field? (not a string that can be converted to a number).

Returns:
'True' if field is a numeric field

Definition at line 1476 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::ResetPosition  )  [inline]
 

Reset position information about the field.

Definition at line 1480 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetAutoIncrement UINT32  count  )  [inline]
 

Set the AutoIncrement number for the next added record.

Definition at line 1484 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetDecimalPlaces int  decplaces  )  [inline]
 

Set the number of decimal places for floating point fields.

Definition at line 1489 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetDispUnits int  unit  )  [inline]
 

Set the display units for this field.

Definition at line 1494 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetDispWidth int  width  )  [inline]
 

Set the display width (number of columns) for the field.

Definition at line 1499 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetDomainID const RVC::OBJECTNAME name  )  [inline]
 

Set the Domain ID for this field.

Definition at line 1504 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetFlags FLAGS  flags  )  [inline]
 

Set field flags.

Definition at line 1509 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetLink INT32  TableNum,
INT32  FieldNum,
NEXTFIELD  NextFieldNum
[inline]
 

Set this field to link to a field in another table.

Definition at line 1526 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetLink INT32  TableNum,
INT32  FieldNum,
INT32  NextFieldNum = -1
[inline]
 

Set this field to link to a field in another table.

Definition at line 1514 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetName TEXTID  textid  )  [inline]
 

Set the name of this field.

Definition at line 1543 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetName const RVC::OBJECTNAME name  )  [inline]
 

Set the name of this field.

Definition at line 1538 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetNextLinkField INT32  NextFieldNum  )  [inline]
 

Set the next field number that this field is linked to.

Definition at line 1548 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetSize INT32  size  )  [inline]
 

Set the size of this field in bytes.

Definition at line 1553 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetType TYPE  type  )  [inline]
 

Set the field type.

Definition at line 1558 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetUnits const UNITCONV conv  )  [inline]
 

Set the field units.

Definition at line 1563 of file dbtable.h.

void RVC::DBTABLE::FIELDINFO::SetUsage USAGE  usage  )  [inline]
 

Set the field usage.

Definition at line 1572 of file dbtable.h.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:21:20 2004 for TNTsdk by  doxygen 1.3.8-20040913