JegasAPI - www.jegas.com

Class JFC_BUFFER

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type JFC_BUFFER = class(JFC_DLITEM)

Description

no description available, JFC_DLITEM description follows

BASE Class for everything (By using this as base - a class can be directly manipulated by classes derived from JFC_DL. If this isn't possible you still can JFC_DL. For this situation - JFC_DL was "recreated" for Version 3 of this Library - Its not 100% Compatible - Names changed to match V3 - but its basicly the same thing - ONLY FASTER and LEANER than ever. Dynamic Linked List Navigation is FAST but sorting is a bit trickier. There is a method for SWAPPING Linked List positions but for faster sorting (without using an array directly) I'd use lpPTR for my objects and just swap pointers or something... I'm not a sorting genuis anyways.

Hierarchy

Overview

Fields

Private pvt_lpBuffer: pointer;
Private pvt_uSize: UInt64;
Private pvt_uSizePerItem: UInt64;
Public uItems: UInt64;

Methods

Public Constructor create(p_uSize: UInt64; p_uSizePerItem: UInt64);
Public Destructor destroy; override;
Public Function chIn(p_ch: char): boolean;
Public Function saOut: AnsiString;
Public procedure DeleteAll;
Public Procedure SaIn(Var p_sa: AnsiString);
Private Procedure write_uSize(p_u: UInt64);

Properties

Public property lpBuffer: pointer read pvt_lpBuffer;
Public property uSize: UInt64 read pvt_usize Write write_usize;
Public property uSizePerItem: UInt64 read pvt_uSizePerItem;

Description

Fields

Private pvt_lpBuffer: pointer;
 
Private pvt_uSize: UInt64;

=============================================================================

Private pvt_uSizePerItem: UInt64;
 
Public uItems: UInt64;

Used for "How Much In Buffer" scratch variable for your programs/units and used by "saIn" method of this class. Modified by "SAIN(ansistring)" automatically and USED as a GUIDE for "saOut: ansistring" You can use as a scratch variable also.

Methods

Public Constructor create(p_uSize: UInt64; p_uSizePerItem: UInt64);
 
Public Destructor destroy; override;
 
Public Function chIn(p_ch: char): boolean;

This function adds the char to the buffer as an alternative to sending in a string. This should process faster than using the saIn procedure to process individual characters/bytes. the function returns false if the char can not fit in the buffer.

Public Function saOut: AnsiString;

Returns ansistring of contents in buffer, iBytesInBuffer long Internally MOVE is used so it should be fast.

Public procedure DeleteAll;

Does what it looks like. Its here for convenience. Setting the Size of the buffer (uSize) to zero does the same thing.

Public Procedure SaIn(Var p_sa: AnsiString);

Copies an ansistring into buffer This uses MOVE and DELETE so it should be fast. The AnsiString PARAMETER you send WILL be modified! IF the whole String fits in the buffer - then it will come back empty. If only part fits in the buffer - then the part that fits will be deleted and the shortened (not fitting) portion will be what you have left. Use iBytesInBuffer to get the number of bytes actually copied to the buffer and subsequently "Delete"'d from your passed parameter. Forced to make my own DELETE called DELETESTRING cuz FPC version crashed with 2 meg ansistring when trying to "DELETE" LEft 1 meg of it. DELETESTRING is in u03g_strings.pp Uses FPC sysutils LEftStr and RightStr - Should be fairly fast still and does try to prevent errors.

Private Procedure write_uSize(p_u: UInt64);
 

Properties

Public property lpBuffer: pointer read pvt_lpBuffer;
 
Public property uSize: UInt64 read pvt_usize Write write_usize;

Resize BUFFER - Contents Preserved but "NEW" empty space is not ZERO filled or anything.

Public property uSizePerItem: UInt64 read pvt_uSizePerItem;
 
JegasAPI - www.jegas.com
Generated by PasDoc 0.14.0.