| Class TBinaryDataSet (unit bindata) |
TDataSet
| Constructors |
constructor Create(AOwner:tComponent);| Functions |
procedure CreateTable;
Procedure PackTable;
Procedure SortTable(SortFields : Array of String);
Procedure UnsortTable;
function AllocRecordBuffer: PChar;____________________________________________________________________________ tBinaryDataSet.
procedure FreeRecordBuffer(var Buffer: PChar);
procedure GetBookmarkData(Buffer: PChar;
Data: Pointer);
function GetBookmarkFlag(Buffer: PChar):
TBookmarkFlag;
function GetFieldData(Field: TField;
Buffer: Pointer): Boolean;
function GetRecNo: Integer;
function GetRecord(Buffer: PChar; GetMode: TGetMode;
DoCheck: Boolean): TGetResult;
function GetRecordCount: Integer;____________________________________________________________________________ tBinaryDataSet.
function GetRecordSize: Word;
procedure InternalAddRecord(Buffer: Pointer;
Append: Boolean);
procedure InternalClose;
procedure InternalDelete;
procedure InternalFirst;
procedure InternalGotoBookmark(
Bookmark: Pointer);
procedure InternalHandleException;
procedure InternalInitFieldDefs;
procedure InternalInitRecord(Buffer: PChar);
procedure InternalLast;
procedure InternalOpen;
procedure InternalPost;
procedure InternalSetToRecord(Buffer: PChar);
function IsCursorOpen: Boolean;
procedure SetBookmarkData(Buffer: PChar;
Data: Pointer);
procedure SetBookmarkFlag(Buffer: PChar;
Value: TBookmarkFlag);
procedure SetFieldData(Field: TField;
Buffer: Pointer);
procedure SetRecNo(Value: Integer);
Procedure WriteHeader;
Procedure _AppendRecord(Buffer:PChar);
Function _CompareRecords(SortFields:Array of String;Rec1,Rec2:Integer):Integer;
Procedure _ReadRecord(Buffer:PChar;IntRecNum:Integer);
Procedure _SwapRecords(Rec1,REc2:Integer);
Procedure _WriteRecord(Buffer:PChar;IntRecNum:Integer);| Properties |
property Active :
property AfterCancel :
property AfterClose :
property AfterDelete :
property AfterEdit :
property AfterInsert :
property AfterOpen :
property AfterPost :
property AfterScroll :
property BeforeCancel :
property BeforeClose :
property BeforeDelete :
property BeforeEdit :
property BeforeInsert :
property BeforeOpen :
property BeforePost :
property BeforeScroll :
property DataFileHeader : tDataFileHeader
property Filtered :
property ReadOnly : Boolean
property TableName : string| Events |
event OnCalcFields :
event OnDeleteError :
event OnEditError :
event OnFilterRecord :
event OnNewRecord :
event OnPostError : | Variables |
BofCrack : Integer;
EofCrack : Integer;
FCurrentRecord : Integer;
fDataFileHeader : tDataFileHeader;
FDataFileHeaderSize : Integer;
FFieldOffset : TList;
FIsTableOpen : Boolean;
fReadOnly : Boolean;
FRecordBufferSize : Integer;
FRecordCount : Integer;
fRecordHeaderSize : Integer;
FRecordInfoOffset : Integer;
FRecordSize : Integer;
FStream : TStream;
FTableName : string;| Constructors |
constructor Create(AOwner:tComponent);____________________________________________________________________________ tBinaryDataSet.Create
| Functions |
procedure CreateTable;____________________________________________________________________________ tBinaryDataSet.CreateTable I: Create a new table/file
Procedure PackTable;____________________________________________________________________________ tBinaryDataSet.PackTable Enhancement: Remove all deleted items from the table.
Procedure SortTable(SortFields : Array of String);____________________________________________________________________________ tBinaryDataSet.SortTable Enhancement: Sort the table by the fields passed.
Procedure UnsortTable;____________________________________________________________________________ tBinaryDataSet.UnsortTable Used to help test the sort routine. Attempts to generate a random dispersment of the records in the dataset.
function AllocRecordBuffer: PChar;TDataSet virtual abstract method
____________________________________________________________________________ tBinaryDataSet.AllocRecordBuffer / III: Allocate a buffer for the record
procedure FreeRecordBuffer(var Buffer: PChar);____________________________________________________________________________ tBinaryDataSet.FreeRecordBuffer III: Free the buffer
procedure GetBookmarkData(Buffer: PChar;
Data: Pointer);____________________________________________________________________________ tBinaryDataSet.GetBookmarkData II: read the bookmark data from record buffer
function GetBookmarkFlag(Buffer: PChar):
TBookmarkFlag;____________________________________________________________________________ tBinaryDataSet.GetBookmarkFlag II: retrieve bookmarks flags from buffer
function GetFieldData(Field: TField;
Buffer: Pointer): Boolean;____________________________________________________________________________ tBinaryDataSet.GetFieldData III: Move data from record buffer to field
function GetRecNo: Integer;____________________________________________________________________________ tBinaryDataSet.GetRecNo II (optional): Get the number of the current record
function GetRecord(Buffer: PChar; GetMode: TGetMode;
DoCheck: Boolean): TGetResult;____________________________________________________________________________ tBinaryDataSet.GetRecord III: Retrieve data for current, previous, or next record (eventually moving to it) and return the status
function GetRecordCount: Integer;TDataSet virtual method (optional
____________________________________________________________________________ tBinaryDataSet.GetRecordCount II (optional): Record count
function GetRecordSize: Word;//////////////////////////////////////// //// Part III: //// Record buffers and field management //////////////////////////////////////// ____________________________________________________________________________ tBinaryDataSet.GetRecordSize / III: Determine the size of each record buffer in memory
procedure InternalAddRecord(Buffer: Pointer;
Append: Boolean);____________________________________________________________________________ tBinaryDataSet.InternalAddRecord III: Add the current data to the file
procedure InternalClose;____________________________________________________________________________ tBinaryDataSet.InternalClose I: close the table/file
procedure InternalDelete;____________________________________________________________________________ tBinaryDataSet.InternalDelete III: Delete the current record
procedure InternalFirst;____________________________________________________________________________ tBinaryDataSet.InternalFirst II: Go to a special position before the first record
procedure InternalGotoBookmark(
Bookmark: Pointer);////////////////////////////////////// //// Part II: //// Bookmarks management and movement ////////////////////////////////////// ____________________________________________________________________________ tBinaryDataSet.InternalGotoBookmark II: set the requested bookmark as current record
procedure InternalHandleException;____________________________________________________________________________ tBinaryDataSet.InternalHandleException default exception handling
procedure InternalInitFieldDefs;____________________________________________________________________________ tBinaryDataSet.InternalInitFieldDefs I: define the fields
procedure InternalInitRecord(Buffer: PChar);____________________________________________________________________________ tBinaryDataSet.InternalInitRecord III: Initialize the record (set to zero
procedure InternalLast;____________________________________________________________________________ tBinaryDataSet.InternalLast II: Go to a special position after the last record
procedure InternalOpen;/////////////////////////////////////////////// //// Part I: //// Initialization, opening, and closing /////////////////////////////////////////////// ____________________________________________________________________________ tBinaryDataSet.InternalOpen I: open the table/file
procedure InternalPost;____________________________________________________________________________ tBinaryDataSet.InternalPost III: Write the current data to the file
procedure InternalSetToRecord(Buffer: PChar);____________________________________________________________________________ tBinaryDataSet.InternalSetToRecord II: same as above (but passes a buffer
function IsCursorOpen: Boolean;____________________________________________________________________________ tBinaryDataSet.IsCursorOpen I: is table open
procedure SetBookmarkData(Buffer: PChar;
Data: Pointer);____________________________________________________________________________ tBinaryDataSet.SetBookmarkData II: set the bookmark data in the buffer
procedure SetBookmarkFlag(Buffer: PChar;
Value: TBookmarkFlag);____________________________________________________________________________ tBinaryDataSet.SetBookmarkFlag II: change the bookmark flags in the buffer
procedure SetFieldData(Field: TField;
Buffer: Pointer);____________________________________________________________________________ tBinaryDataSet.SetFieldData III: Move data from field to record buffer
procedure SetRecNo(Value: Integer);____________________________________________________________________________ tBinaryDataSet.SetRecNo II (optional): Move to the given record number
Procedure WriteHeader;____________________________________________________________________________ tBinaryDataSet.WriteHeader
Procedure _AppendRecord(Buffer:PChar);____________________________________________________________________________ tBinaryDataSet._AppendRecord
Function _CompareRecords(SortFields:Array of String;Rec1,Rec2:Integer):Integer;____________________________________________________________________________ tBinaryDataSet._CompareRecords Compare two records. Returns -1 if REC1 < REC2, 0 if REC1 = REC2, or 1 if REC1 > REC2.
Procedure _ReadRecord(Buffer:PChar;IntRecNum:Integer);**************************************************************************** Low Level Routines for accessing an internal record ____________________________________________________________________________ tBinaryDataSet._ReadRecord
Procedure _SwapRecords(Rec1,REc2:Integer);____________________________________________________________________________ tBinaryDataSet._SwapRecords Enhancement: Quick swap of two records. Used primarily for sorting.
Procedure _WriteRecord(Buffer:PChar;IntRecNum:Integer);____________________________________________________________________________ tBinaryDataSet._WriteRecord
| Properties |
property Active : redeclared data set properties
property AfterCancel :
property AfterClose :
property AfterDelete :
property AfterEdit :
property AfterInsert :
property AfterOpen :
property AfterPost :
property AfterScroll :
property BeforeCancel :
property BeforeClose :
property BeforeDelete :
property BeforeEdit :
property BeforeInsert :
property BeforeOpen :
property BeforePost :
property BeforeScroll :
property DataFileHeader : tDataFileHeader
property Filtered :
property ReadOnly : Boolean
property TableName : string| Events |
event OnCalcFields :
event OnDeleteError :
event OnEditError :
event OnFilterRecord :
event OnNewRecord :
event OnPostError : | Variables |
BofCrack : Integer;current record (0 to FRecordCount - 1
EofCrack : Integer;before the first record (crack
FCurrentRecord : Integer;offset of RecInfo in record buffer
fDataFileHeader : tDataFileHeader;table path and file name
FDataFileHeaderSize : Integer;after the last record (crack) file header size
FFieldOffset : TList;field offsets in record
FIsTableOpen : Boolean;status
fReadOnly : Boolean;Enhancements
FRecordBufferSize : Integer;the size of the actual data
FRecordCount : Integer;The size of the record header
fRecordHeaderSize : Integer;record data
FRecordInfoOffset : Integer;data + housekeeping (TRecInfo
FRecordSize : Integer;current number of record
FStream : TStream;
FTableName : string;the physical table