TZRowAccessor Class Reference

Implements a column buffer accessor. More...

Inherits TObject.

List of all members.

Public Member Functions

PZRowBuffer Alloc ()
PZRowBuffer AllocBuffer (PZRowBuffer &Buffer)
 Allocates a new row buffer and sets it into the variable.
 Clear ()
 ClearBuffer (PZRowBuffer Buffer)
 CloneBuffer (PZRowBuffer SrcBuffer, PZRowBuffer DestBuffer)
 Clones the row buffer from source to destination row.
 CloneFrom (PZRowBuffer SrcBuffer)
 CloneTo (PZRowBuffer DestBuffer)
Integer CompareBuffers (PZRowBuffer Buffer1, PZRowBuffer Buffer2, TIntegerDynArray ColumnIndices, TBooleanDynArray ColumnDirs)
 Compares fields from two row buffers.
 CopyBuffer (PZRowBuffer SrcBuffer, PZRowBuffer DestBuffer)
 Copies the row buffer from source to destination row.
 CopyFrom (PZRowBuffer SrcBuffer)
 CopyTo (PZRowBuffer DestBuffer)
 Dispose ()
 DisposeBuffer (PZRowBuffer Buffer)
 Disposes the specified row buffer.
TStream GetAsciiStream (Integer ColumnIndex, Boolean &IsNull)
Extended GetBigDecimal (Integer ColumnIndex, Boolean &IsNull)
TStream GetBinaryStream (Integer ColumnIndex, Boolean &IsNull)
IZBlob GetBlob (Integer ColumnIndex, Boolean &IsNull)
Boolean GetBoolean (Integer ColumnIndex, Boolean &IsNull)
ShortInt GetByte (Integer ColumnIndex, Boolean &IsNull)
TByteDynArray GetBytes (Integer ColumnIndex, Boolean &IsNull)
Boolean GetColumnCase (Integer ColumnIndex)
Pointer GetColumnData (Integer ColumnIndex, Boolean &IsNull)
Integer GetColumnDataSize (Integer ColumnIndex)
Integer GetColumnLength (Integer ColumnIndex)
string GetColumnName (Integer ColumnIndex)
Integer GetColumnOffSet (Integer ColumnIndex)
TZSQLType GetColumnType (Integer ColumnIndex)
TDateTime GetDate (Integer ColumnIndex, Boolean &IsNull)
Double GetDouble (Integer ColumnIndex, Boolean &IsNull)
Single GetFloat (Integer ColumnIndex, Boolean &IsNull)
Integer GetInt (Integer ColumnIndex, Boolean &IsNull)
Int64 GetLong (Integer ColumnIndex, Boolean &IsNull)
PChar GetPChar (Integer ColumnIndex, Boolean &IsNull)
SmallInt GetShort (Integer ColumnIndex, Boolean &IsNull)
string GetString (Integer ColumnIndex, Boolean &IsNull)
TDateTime GetTime (Integer ColumnIndex, Boolean &IsNull)
TDateTime GetTimestamp (Integer ColumnIndex, Boolean &IsNull)
TStream GetUnicodeStream (Integer ColumnIndex, Boolean &IsNull)
WideString GetUnicodeString (Integer ColumnIndex, Boolean &IsNull)
TZVariant GetValue (Integer ColumnIndex)
 Init ()
 InitBuffer (PZRowBuffer Buffer)
 Initializes the row buffer.
Boolean IsNull (Integer ColumnIndex)
 MoveBuffer (PZRowBuffer SrcBuffer, PZRowBuffer DestBuffer)
 Moves the row buffer from source to destination row.
 MoveFrom (PZRowBuffer SrcBuffer)
 MoveTo (PZRowBuffer DestBuffer)
 SetAsciiStream (Integer ColumnIndex, TStream Value)
 SetBigDecimal (Integer ColumnIndex, Extended Value)
 SetBinaryStream (Integer ColumnIndex, TStream Value)
 SetBlob (Integer ColumnIndex, IZBlob Value)
 SetBoolean (Integer ColumnIndex, Boolean Value)
 SetByte (Integer ColumnIndex, ShortInt Value)
 SetBytes (Integer ColumnIndex, TByteDynArray Value)
 SetDate (Integer ColumnIndex, TDateTime Value)
 SetDouble (Integer ColumnIndex, Double Value)
 SetFloat (Integer ColumnIndex, Single Value)
 SetInt (Integer ColumnIndex, Integer Value)
 SetLong (Integer ColumnIndex, Int64 Value)
 SetNotNull (Integer ColumnIndex)
 SetNull (Integer ColumnIndex)
 SetPChar (Integer ColumnIndex, PChar Value)
 SetShort (Integer ColumnIndex, SmallInt Value)
 SetString (Integer ColumnIndex, string Value)
 SetTime (Integer ColumnIndex, TDateTime Value)
 SetTimestamp (Integer ColumnIndex, TDateTime Value)
 SetUnicodeStream (Integer ColumnIndex, TStream Value)
 SetUnicodeString (Integer ColumnIndex, WideString Value)
 SetValue (Integer ColumnIndex, TZVariant Value)
 TZRowAccessor (TObjectList ColumnsInfo)
 Creates this object and assignes the main properties.
 ~TZRowAccessor ()
 Destroys this object and cleanups the memory.

Public Attributes

Integer ColumnsSize
PZRowBuffer RowBuffer
Integer RowSize

Protected Member Functions

 CheckColumnConvertion (Integer ColumnIndex, TZSQLType ResultType)
 Checks is the column convertion from one type to another type allowed.
 CheckColumnIndex (Integer ColumnIndex)
 Checks is the column index correct and row buffer is available.

Private Types

typedef array< Boolean > FColumnCases
typedef array< Integer > FColumnLengths
typedef array< string > FColumnNames
typedef array< Integer > FColumnOffsets
typedef array< TZSQLTypeFColumnTypes

Private Member Functions

IZBlob GetBlobObject (PZRowBuffer Buffer, Integer ColumnIndex)
 Gets a stream from the specified columns.
Integer GetColumnSize (TZColumnInfo ColumnInfo)
 Gets a size of column with the specified type.
 SetBlobObject (PZRowBuffer Buffer, Integer ColumnIndex, IZBlob Value)
 Sets a blob into the specified columns.

Private Attributes

PZRowBuffer FBuffer
Integer FColumnCount
Integer FColumnsSize
Boolean FHasBlobs
Integer FRowSize
string FTemp


Detailed Description

Implements a column buffer accessor.

Definition at line 105 of file ZDbcCache.pas.


Member Typedef Documentation

typedef array<Boolean> TZRowAccessor::FColumnCases [private]

Definition at line 117 of file ZDbcCache.pas.

typedef array<Integer> TZRowAccessor::FColumnLengths [private]

Definition at line 119 of file ZDbcCache.pas.

typedef array<string> TZRowAccessor::FColumnNames [private]

Definition at line 116 of file ZDbcCache.pas.

typedef array<Integer> TZRowAccessor::FColumnOffsets [private]

Definition at line 120 of file ZDbcCache.pas.

typedef array<TZSQLType> TZRowAccessor::FColumnTypes [private]

Definition at line 118 of file ZDbcCache.pas.


Constructor & Destructor Documentation

TZRowAccessor::TZRowAccessor ( TObjectList  ColumnsInfo  ) 

Creates this object and assignes the main properties.

Parameters:
ColumnsInfo a collection with column information.

Definition at line 519 of file ZDbcCache.pas.

TZRowAccessor::~TZRowAccessor (  ) 

Destroys this object and cleanups the memory.

Definition at line 559 of file ZDbcCache.pas.


Member Function Documentation

PZRowBuffer TZRowAccessor::Alloc (  ) 

PZRowBuffer TZRowAccessor::AllocBuffer ( PZRowBuffer Buffer  ) 

Allocates a new row buffer and sets it into the variable.

Parameters:
Buffer a pointer to row buffer.
Returns:
a pointer to the allocated buffer.

Definition at line 726 of file ZDbcCache.pas.

TZRowAccessor::CheckColumnConvertion ( Integer  ColumnIndex,
TZSQLType  ResultType 
) [protected]

Checks is the column convertion from one type to another type allowed.

Parameters:
ColumnIndex an index of column.
ResultType a requested data type.
Returns:
true if convertion is allowed or throw exception otherwise.

Definition at line 592 of file ZDbcCache.pas.

TZRowAccessor::CheckColumnIndex ( Integer  ColumnIndex  )  [protected]

Checks is the column index correct and row buffer is available.

Parameters:
ColumnIndex an index of column.

Definition at line 571 of file ZDbcCache.pas.

TZRowAccessor::Clear (  ) 

TZRowAccessor::ClearBuffer ( PZRowBuffer  Buffer  ) 

TZRowAccessor::CloneBuffer ( PZRowBuffer  SrcBuffer,
PZRowBuffer  DestBuffer 
)

Clones the row buffer from source to destination row.

Parameters:
SrcBuffer a pointer to source row buffer.
DestBuffer a pointer to destination row buffer.

Definition at line 825 of file ZDbcCache.pas.

TZRowAccessor::CloneFrom ( PZRowBuffer  SrcBuffer  ) 

TZRowAccessor::CloneTo ( PZRowBuffer  DestBuffer  ) 

Integer TZRowAccessor::CompareBuffers ( PZRowBuffer  Buffer1,
PZRowBuffer  Buffer2,
TIntegerDynArray  ColumnIndices,
TBooleanDynArray  ColumnDirs 
)

Compares fields from two row buffers.

Parameters:
Buffer1 the first row buffer to compare.
Buffer2 the second row buffer to compare.
ColumnIndices column indices to compare.
ColumnDirs compare direction for each columns.

TZRowAccessor::CopyBuffer ( PZRowBuffer  SrcBuffer,
PZRowBuffer  DestBuffer 
)

Copies the row buffer from source to destination row.

Parameters:
SrcBuffer a pointer to source row buffer.
DestBuffer a pointer to destination row buffer.

Definition at line 775 of file ZDbcCache.pas.

TZRowAccessor::CopyFrom ( PZRowBuffer  SrcBuffer  ) 

TZRowAccessor::CopyTo ( PZRowBuffer  DestBuffer  ) 

TZRowAccessor::Dispose (  ) 

TZRowAccessor::DisposeBuffer ( PZRowBuffer  Buffer  ) 

Disposes the specified row buffer.

Parameters:
Buffer a pointer to row buffer.

Definition at line 741 of file ZDbcCache.pas.

TStream TZRowAccessor::GetAsciiStream ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Extended TZRowAccessor::GetBigDecimal ( Integer  ColumnIndex,
Boolean &  IsNull 
)

TStream TZRowAccessor::GetBinaryStream ( Integer  ColumnIndex,
Boolean &  IsNull 
)

IZBlob TZRowAccessor::GetBlob ( Integer  ColumnIndex,
Boolean &  IsNull 
)

IZBlob TZRowAccessor::GetBlobObject ( PZRowBuffer  Buffer,
Integer  ColumnIndex 
) [private]

Gets a stream from the specified columns.

Parameters:
Buffer a row buffer.
ColumnIndex an index of the column.

Definition at line 662 of file ZDbcCache.pas.

Boolean TZRowAccessor::GetBoolean ( Integer  ColumnIndex,
Boolean &  IsNull 
)

ShortInt TZRowAccessor::GetByte ( Integer  ColumnIndex,
Boolean &  IsNull 
)

TByteDynArray TZRowAccessor::GetBytes ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Boolean TZRowAccessor::GetColumnCase ( Integer  ColumnIndex  ) 

Pointer TZRowAccessor::GetColumnData ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Integer TZRowAccessor::GetColumnDataSize ( Integer  ColumnIndex  ) 

Integer TZRowAccessor::GetColumnLength ( Integer  ColumnIndex  ) 

string TZRowAccessor::GetColumnName ( Integer  ColumnIndex  ) 

Integer TZRowAccessor::GetColumnOffSet ( Integer  ColumnIndex  ) 

Integer TZRowAccessor::GetColumnSize ( TZColumnInfo  ColumnInfo  )  [private]

Gets a size of column with the specified type.

Parameters:
ColumnInfo a column information struct.
Returns:
a size for the column with the specified type.

Definition at line 618 of file ZDbcCache.pas.

TZSQLType TZRowAccessor::GetColumnType ( Integer  ColumnIndex  ) 

TDateTime TZRowAccessor::GetDate ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Double TZRowAccessor::GetDouble ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Single TZRowAccessor::GetFloat ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Integer TZRowAccessor::GetInt ( Integer  ColumnIndex,
Boolean &  IsNull 
)

Int64 TZRowAccessor::GetLong ( Integer  ColumnIndex,
Boolean &  IsNull 
)

PChar TZRowAccessor::GetPChar ( Integer  ColumnIndex,
Boolean &  IsNull 
)

SmallInt TZRowAccessor::GetShort ( Integer  ColumnIndex,
Boolean &  IsNull 
)

string TZRowAccessor::GetString ( Integer  ColumnIndex,
Boolean &  IsNull 
)

TDateTime TZRowAccessor::GetTime ( Integer  ColumnIndex,
Boolean &  IsNull 
)

TDateTime TZRowAccessor::GetTimestamp ( Integer  ColumnIndex,
Boolean &  IsNull 
)

TStream TZRowAccessor::GetUnicodeStream ( Integer  ColumnIndex,
Boolean &  IsNull 
)

WideString TZRowAccessor::GetUnicodeString ( Integer  ColumnIndex,
Boolean &  IsNull 
)

TZVariant TZRowAccessor::GetValue ( Integer  ColumnIndex  ) 

TZRowAccessor::Init (  ) 

TZRowAccessor::InitBuffer ( PZRowBuffer  Buffer  ) 

Initializes the row buffer.

Parameters:
Buffer a pointer to row buffer.

Definition at line 756 of file ZDbcCache.pas.

Boolean TZRowAccessor::IsNull ( Integer  ColumnIndex  ) 

TZRowAccessor::MoveBuffer ( PZRowBuffer  SrcBuffer,
PZRowBuffer  DestBuffer 
)

Moves the row buffer from source to destination row.

Source buffer is cleaned up after the operation.

Parameters:
SrcBuffer a pointer to source row buffer.
DestBuffer a pointer to destination row buffer.

Definition at line 809 of file ZDbcCache.pas.

TZRowAccessor::MoveFrom ( PZRowBuffer  SrcBuffer  ) 

TZRowAccessor::MoveTo ( PZRowBuffer  DestBuffer  ) 

TZRowAccessor::SetAsciiStream ( Integer  ColumnIndex,
TStream  Value 
)

TZRowAccessor::SetBigDecimal ( Integer  ColumnIndex,
Extended  Value 
)

TZRowAccessor::SetBinaryStream ( Integer  ColumnIndex,
TStream  Value 
)

TZRowAccessor::SetBlob ( Integer  ColumnIndex,
IZBlob  Value 
)

TZRowAccessor::SetBlobObject ( PZRowBuffer  Buffer,
Integer  ColumnIndex,
IZBlob  Value 
) [private]

Sets a blob into the specified columns.

Parameters:
Buffer a row buffer.
ColumnIndex an index of the column.
Value a stream object to be set.

Definition at line 691 of file ZDbcCache.pas.

TZRowAccessor::SetBoolean ( Integer  ColumnIndex,
Boolean  Value 
)

TZRowAccessor::SetByte ( Integer  ColumnIndex,
ShortInt  Value 
)

TZRowAccessor::SetBytes ( Integer  ColumnIndex,
TByteDynArray  Value 
)

TZRowAccessor::SetDate ( Integer  ColumnIndex,
TDateTime  Value 
)

TZRowAccessor::SetDouble ( Integer  ColumnIndex,
Double  Value 
)

TZRowAccessor::SetFloat ( Integer  ColumnIndex,
Single  Value 
)

TZRowAccessor::SetInt ( Integer  ColumnIndex,
Integer  Value 
)

TZRowAccessor::SetLong ( Integer  ColumnIndex,
Int64  Value 
)

TZRowAccessor::SetNotNull ( Integer  ColumnIndex  ) 

TZRowAccessor::SetNull ( Integer  ColumnIndex  ) 

TZRowAccessor::SetPChar ( Integer  ColumnIndex,
PChar  Value 
)

TZRowAccessor::SetShort ( Integer  ColumnIndex,
SmallInt  Value 
)

TZRowAccessor::SetString ( Integer  ColumnIndex,
string  Value 
)

TZRowAccessor::SetTime ( Integer  ColumnIndex,
TDateTime  Value 
)

TZRowAccessor::SetTimestamp ( Integer  ColumnIndex,
TDateTime  Value 
)

TZRowAccessor::SetUnicodeStream ( Integer  ColumnIndex,
TStream  Value 
)

TZRowAccessor::SetUnicodeString ( Integer  ColumnIndex,
WideString  Value 
)

TZRowAccessor::SetValue ( Integer  ColumnIndex,
TZVariant  Value 
)


Member Data Documentation

See also:
FColumnsSize For reading

Definition at line 494 of file ZDbcCache.pas.

Definition at line 121 of file ZDbcCache.pas.

Integer TZRowAccessor::FColumnCount [private]

Definition at line 114 of file ZDbcCache.pas.

Integer TZRowAccessor::FColumnsSize [private]

Definition at line 112 of file ZDbcCache.pas.

Boolean TZRowAccessor::FHasBlobs [private]

Definition at line 123 of file ZDbcCache.pas.

Integer TZRowAccessor::FRowSize [private]

Definition at line 110 of file ZDbcCache.pas.

string TZRowAccessor::FTemp [private]

Definition at line 125 of file ZDbcCache.pas.

See also:
FBuffer For reading

FBuffer For writing

Definition at line 500 of file ZDbcCache.pas.

See also:
FRowSize For reading

Definition at line 497 of file ZDbcCache.pas.


The documentation for this class was generated from the following file:

Generated on Wed Dec 30 08:42:56 2009 for zeoslib by  doxygen 1.5.7.1