#include <dbfield.h>
Public Methods | |
DbField (LOOK_STMT theStmt, int theColumn) | |
Constructor. More... | |
virtual | ~DbField () |
Destructor. | |
const LookTypeBase* | GetValue (void) const |
Get the value of the data. More... | |
LookString | GetAsString (void) const |
Get the data as a string. More... | |
LookInteger | GetInteger (void) const |
Get the data as a LookInteger. More... | |
LookMoney | GetMoney (void) const |
Get the data as a LookMoney. More... | |
LookDateTime | GetDateTime (void) const |
Get the data as a LookDateTime. More... | |
LookFloat | GetFloat (void) const |
Get the data as a LookFloat. More... | |
LookNumeric | GetNumeric (void) const |
Get the data as a LookNumeric. More... | |
LookRawData | GetRawData (void) const |
Get the data as a LookRawData. More... | |
bool | IsNull () const |
Is the field null? More... | |
Static Public Methods | |
void | SetFixEmptyStrings (bool theFlag) |
bool | SetFixEmptyStringsAuto (void) |
Set itFixesEmptyStrings (see constructor for use). More... |
This class represents a field of data (intersection of row and column). A DbRow has some of these, and is probably the only class which should construct them. A field can supply its data as various types
|
Constructor. Constructor. This obtains the data from the interface layer and converts it into the appropriate type. If itFixesEmptyStrings, a string of " " is converted to an empty string. (SQL Server doesn't understand empty strings).
|
|
Get the data as a string. Get the data as a string. Floating point values are rounded to 3dp, dates use the default conversion specified in LookDateTime, money uses LookMoney::GetSimpleString(). If the data is not one of string, integer, float, date/time, money, numeric or raw data, an exception is thrown. This should be pretty unlikely.
|
|
Get the data as a LookDateTime. Get the data as a LookDateTime. If the data is not date/time, an exception is thrown. Note date and time data is all stored as LookDateTime.
|
|
Get the data as a LookFloat. Get the data as a LookFloat. If the data is not a float or numeric, an exception is thrown.
|
|
Get the data as a LookInteger. Get the data as a LookInteger. If the data is not integral or numeric, an exception is thrown.
|
|
Get the data as a LookMoney. Get the data as a LookMomey. If the data is not money or numeric, an exception is thrown.
|
|
Get the data as a LookNumeric. Get the data as a LookNumeric. If the data is not integral, money or numeric, an exception is thrown. (float would need a precision).
|
|
Get the data as a LookRawData. Get the data as a LookRawData. If the data is not raw (binary) data, an exception is thrown.
|
|
Get the value of the data. Get the value of the data.
|
|
Is the field null? Is the field null?
|
|
Set itFixesEmptyStrings (see constructor for use). Set itFixesEmptyStrings according to the database type. (Currently only true for SQL Server) The global connection must have been set before using this (DbConnection::SetGlobalConnection()).
|