Midware TMWBuffer

From Overbyte
Revision as of 13:36, 5 May 2011 by Marie (talk | contribs)
Jump to navigation Jump to search

Main page -> Midware component reference -> TMWBuffer

Overview

unit RFormat.pas

TMWBuffer if a very important component in MidWare technology. TMWBuffer implement data storage and formatting for transmission. Data echanged between client and server is exactly TMWBuffer content, byte for byte.

TMWBuffer can be seen as a data table in memory. This table is organized as records made of variable field number, each field having a variable length.

TMWBuffer provides methods and properties to read, write and sort data. Data is stored in a very simple format: a buffer dynamically allocated from memory that contains all fields and records. Fields and records boundaries are marked with delimiters. If control characaters or delimiters are found within data, they are escaped. Three delimiters are used: escape delimiter, field delimiter and record delimiter. They are placed at start of buffer in order to consitute a kind of dictionnary.

Properties

AutoExpand AutoExpand property tells the component if the data buffer can be expanded when it is too short for the data that needs to be written to it.
Bof Bof property is TRUE when current position has reached begin of file.
DataBuffer Gives access to the underlaying data buffer.
DataBufferCount he size in bytes of the data present in the buffer.
DataBufferSize The size in bytes of the current buffer.
Eof Eof property is TRUE when current position has reached end of file.
FieldCount Returns the number of fields in the current record.
Fields The indexed Fields[] property gives access to the current record's fields.
FieldSize Return field size in bytes.
FieldType Read only indexed property returning filed type for a given field in current record.
HasData HasData property is TRUE when TMWBuffer contains data.
HeaderSize Size in byte of the header in the data buffer. Default to 0.
MetaData Read only indexed MetaData property gives access to the current record's meta data (application defined).
RecordCount Readonly property RecordCount retunrs the number of records stored in TMWBuffer. See also FieldCount.

Methods

DisconnectAll Disconnect every connected client. Do not confuse with the Stop method.
Start The start procedure will start the server. The server will accept new client connections. See also Stop.
Stop The Stop procedure will stop the server which will no more accept new clients, but will not disconnect already connected clients. See also Start.