Unit RFormat

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Author: François PIETTE Description: Buffer handling for F. Piette's Middleware (MidWare) EMail: francois.piette@pophost.eunet.be francois.piette@ping.be francois.piette@rtfm.be http://www.rtfm.be/fpiette Creation: February 17, 1998 Version: 1.09 Support: Use the mailing list midware@rtfm.be See website for details. Legal issues: Copyright (C) 1997, 1998 by François PIETTE Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56 This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software and or any derived or altered versions for any purpose, excluding commercial applications. You can use this software for personal or internal use only. You may distribute it freely untouched. The following restrictions applies: 1. The origin of this software must not be misrepresented, you must not claim that you wrote the original software. 2. If you use this software in a product, an acknowledgment in the product documentation and displayed on screen is required. The text must be: "This product is based on MidWare. Freeware source code is available at http://www.rtfm.be/fpiette." 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. This notice may not be removed or altered from any source distribution and must be added to the product documentation. Updates: Mar 11, 1998 V1.01 Corrected bug in Prior method which had old code related a no more existent header. Mar 13, 1998 V1.02 Implemented GetBookmark, FreeBookmark, GotoBookmark and Delete methods to make it similar to TTable component. Revised logic for Eof, Bof, First, Last, Next, Prior, Delete to make it works exactly as a TTable works. Mar 19, 1998 V1.03 Added a HeaderSize property to reserve space for any header. The component does nothing with this header space, it is just reserved for whatever purpose is needed by the user. This property default to 0 (no header space). Mar 24, 1998 V1.04 AppendFields did'nt adjust the buffer size correctly resulting in a buffer overflow ! Mar 25, 1998 V1.05 Changed RecordToString to double the quotes inside the fields (like you do in pascal when a string constant has embedded quotes). Apr 24, 1998 V1.06 Added a third delimiter in front of the buffer to allow blob fields. This make the new format incompatible with previous one ! Added functions to handle blobs (from TStream objects). Introduced the notion of field type. String fields can now contains any data byte except nul bytes but including any control characters, even those used for delimiter. (Nul bytes are prohibed because they are used as a string terminator). You can use the new mwBlob field type to send binary data such as images or exe files. Apr 28, 1998 V1.07 Corected a buffer overflow when a field is writen and if the buffer is too small for the new field length. May 02, 1998 V1.08 Corrected field type extraction in GetStreamField. Thanks to Miha Remec for finding this bug. Jun 01, 1998 V1.09 Removed beta status. Changed "legal stuff" to prohibe commercial application without agreement. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Classes

TMWBuffer - :TMWBuffer is the component responsible for holding data to be transmitted between the client and the server (both directions).

Functions

Register - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} {$IFDEF MAKECOMPONENT

Types

PInteger
TMWFieldType
TPosition

Constants

EscMarker
FieldSeparator
MWBufferVersion
RecordSeparator

Variables


Functions


procedure Register;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} {$IFDEF MAKECOMPONENT

Types


PInteger          = ^Integer

TMWFieldType      = (mwString, mwBlob);

TPosition         = LongInt

Constants

EscMarker = #127

Ascii DC4

FieldSeparator = #18

Default field and record separator in output data

MWBufferVersion = 109

TBookmark, TLocateOption, TLocateOptions

RecordSeparator = #20

Ascii DC2

Variables