C# Class NetBase.Storage.FileTable

An on-disk table. This is loosely based on DBF of course, you can probably use it to read them. However, a lot of the fields are left empty - e.g. data types, etc. etc. These classes might make a good candidate for implementing IEnumerator
Inheritance: ITable
Mostrar archivo Open project: buttonpusher/NetBase Class Usage Examples

Private Properties

Property Type Description
Open void

Public Methods

Method Description
AddRow ( Row r ) : void

Writes a row to disk

CalculateTotalRowSize ( ) : int
CommitToDisk ( string filename ) : void

This method is intended to be used only when creating a new table. So; e.g. not for normal writes.

Dispose ( ) : void
FileTable ( ) : System
FileTable ( string filename ) : System

Opens up a file handle on the table data and reads in the header. Note the file is held open until the FileTable is disposed.

Find ( Predicate p ) : List

Yes, I am sure there is room for optimisation here...

NextRow ( ) : Row

Retrieve the next row. Uses a seek, assuming the underlying framework will be sensible about it (we should usually already be in position)

Reset ( ) : void

Rewind the table back to the beginning

ToByteArray ( ) : byte[]

This is really only needed for sending data over the network in which case the results will (currently) always be the results of a query, and therefore always a MemoryTable

Private Methods

Method Description
Open ( string filename ) : void

Method Details

AddRow() public method

Writes a row to disk
public AddRow ( Row r ) : void
r Row
return void

CalculateTotalRowSize() public method

public CalculateTotalRowSize ( ) : int
return int

CommitToDisk() public method

This method is intended to be used only when creating a new table. So; e.g. not for normal writes.
public CommitToDisk ( string filename ) : void
filename string
return void

Dispose() public method

public Dispose ( ) : void
return void

FileTable() public method

public FileTable ( ) : System
return System

FileTable() public method

Opens up a file handle on the table data and reads in the header. Note the file is held open until the FileTable is disposed.
public FileTable ( string filename ) : System
filename string
return System

Find() public method

Yes, I am sure there is room for optimisation here...
public Find ( Predicate p ) : List
p Predicate
return List

NextRow() public method

Retrieve the next row. Uses a seek, assuming the underlying framework will be sensible about it (we should usually already be in position)
public NextRow ( ) : Row
return Row

Reset() public method

Rewind the table back to the beginning
public Reset ( ) : void
return void

ToByteArray() public method

This is really only needed for sending data over the network in which case the results will (currently) always be the results of a query, and therefore always a MemoryTable
public ToByteArray ( ) : byte[]
return byte[]