SDL Component Suite - DStruct

The unit DSTRUCT contains several classes which support commonly used data structures (FIFO buffers, and bit arrays, string arrays).

  • The class TAssocArray provides an associative string array which is comparable to the array found in PHP.
  • The class TFifo supports the handling of First-In-First-Out (FIFO) and Last-In-First-Out (LIFO) buffers. FIFOs are commonly used for the communication of asynchronous processes.
  • The class TBitFld supports boolean arrays of a size of up to 2^31 entries (approx. 2 billion). TBitFld is highly memory efficient, using only one bit per entry. Each element of the array is addressed by a number between 0 and the maximum specified length of the array.
  • The class TByteMatrix provides a two-dimensional matrix of bytes.
  • The class TRLEncoder supports the run length encoding of byte streams.
  • The class TStringAccu supports the counting of strings.
  • The class TStringArray has been designed for store arrays of strings with special attention to (1) the ease of sorting, (2) the transparent and efficient handling of strings of different lengths, and (3) the efficient use of memory for large sparse arrays.
The unit DSTRUCT is part of the SDL Component Suite. More details can be found in the online help pages.
 


What's new:

  • Release 12.0   [Dec-12, 2023]
     
    • implemented SHA1FromStringUnicode32 to support 32-bit Unicode strings
    • implemented an overloaded version of TStringArray.Sort to provide independent specification of the sort orders
    • the class TBitFld provides two new methods: Hash and SelectRandomBit
    • the new class T2DArrayStack supports stacks of mixed-size two-dimensional arrays
    • bug fix: memory leak in TFeatureMatrix fixed
    • bug fix: TBitFld.RandomFill did not correctly fill the bit field if the number of bits to be set exceeded half the size
    • bug fix: SHA1FromString assumed a 1-byte string and thus processed only the first half of the 2-byte Unicode string; the old version is kept as SHA1FromStringOld

  • Release 10.7   [Aug-24, 2020]
     
  • Release 10.6   [Mar-09, 2018]
     
    • the new class TFeatureMatrix supports mixed-type two-dimensional matrices
    • the TStringArray class supports now the Assign method
    • the class TAssocArray provides now the method ResolveAsInt

  • Release 10.5   [Oct-10, 2016]
     
    • the TBitFld class provides now the Assign method
    • the TStringArray class provides now the array property AsInteger
    • bug fix: SHA1FromFile, SHA1FromString and SHA1FromStream returned wrong results in 64-bit mode

  • Release 10.4   [Jun-02, 2015]
     
    • no changes

  • Release 10.3   [Oct-06, 2014]
     
  • Release 10.2   [May-30, 2013]
     
    • the new class TStringAccu provides a way to count strings

  • Release 10.1   [Oct-29, 2012]
     
  • Release 10.0   [Oct-4, 2011]
     
    • the new method TBitFld.Clone creates a complete copy of an existing bit array

  • Release 9.7   [May-31, 2010]
     
  • Release 9.51   [Dec-01, 2008]
     
  • Release 9.5   [Oct-31, 2008]
     
    • Sort method now provides a secondary sorting key

  • Release 9.0   [May-28, 2007]
     
  • Release 8.5   [Feb-18, 2006]
     
  • Release 8.2   [Nov-03, 2004]
     
    • no changes

  • Release 8.1   [Aug-29, 2004]
     
    • available for Delphi™ 8 for .NET
    • TStringArray is now inherited from TComponent
    • new component TByteMatrix implemented
    • bug fix: FindCellInSortedColumn now correctly finds the first item if several equal strings are stored in subsequent rows
    • bug fix: TStringArray now correctly clears its internal memory if the number of rows of the string array is reduced (bug has been introduced with version 8.0)

  • Release 8.0   [Apr-15, 2004]
     
    • new class TAssocArray provides an associative array of strings
    • IndexOfNearestArrayValue implemented
    • TBitFld: new method FirstTrueBit implemented
    • CRC16ofBuffer and CRC32ofBuffer changed from buffer pointer to open byte array TBytes
    • class TStringArray: CommitSorting implemented
    • OnPercentDone event implemented for TStringArray
    • new function NextPermutation implemented
    • bug fix: TBitFld.CountTrueBits returned wrong result if last bit in a bit field of (size mod 8 = 0) has been set
    • bug fix in TStringArray: reducing array size does no longer destroy sort index

  • Release 7.2   [Mar-23, 2003]
     
    • DSTRUCT is now part of BasePack
    • CalcCRC32ofFile implemented
    • TBitFld, TFifo are now inherited from TComponent

  • Release 7.0   [Sep-15, 2002]
     
    • available for Delphi™ 7.0
    • the unit is now CLX compatible

  • Release 6.5   [May-28, 2002]
     
    • available for C++Builder™ 6.0
    • TStringArray: LoadFromXMLFile, ReadFromOpenXMLFile, SaveAsXMLFile, WriteToOpenXMLFile implemented
    • bug fix: RemoveRow now only empties last row, no break down of code
    • bug fix: InsertRow does no longer destroy the sort order

  • Release 6.0   [Aug-06, 2001]
     
    • available for Delphi™ 6.0
    • new procedures EncodeASCII85 and DecodeASCII85 implemented
    • FindCellExact implemented
    • property Bit of TBitFld is now default property
    • TStringArray.SortOrder is now writable
    • bug fix in FindCell: algorithm works now correctly for multi-column searches
       
  • Release 5.5   [Jun-09, 2000]
     
    • available for C++Builder™ 5.0
    • TStringArray: new property SortOrder implemented
    • property TStringArray.ColAttrib implemented
    • function FindCellInSortedColumn implemented
    • CRC routines implemented (CCITT and 32 bit CRC used in Ethernet LANs)
    • bug fix in RL-Encoder (caused faulty compression under rare circumstances)
       
  • Release 5.0   [Oct-02, 1999]
     
    • available for Delphi™ 5.0
    • method AsNumber of class TStringArray implemented
    • method TStringArray.ColumnEmpty and TStringArray.RowEmpty implemented
    • method TStringArray.FindCell implemented
    • TStringArray - bug fix: deallocation of memory works now correctly
    • property TStringArray.RowAttrib implemented
    • TStringArray: sorting no longer discriminates between lowercase and uppercase letters
    • TStringArray.AddRow implemented
    • TStringArray.RemoveRow implemented
    • TStringArray.InsertRow implemented
    • bug fix in TStringArray.Sort: sort no longer hangs if only one row in string array
    • bug fix in TStringArray.Sort: sort no longer hangs for arrays with more than 2^16 rows
       
  • Release 1.4 [Mar-23, 1999]
     
    • DSTRUCT is now available for C++Builder™ 4.0
       
  • Release 1.3 [Feb-19, 1999]
     
    • class TStringArray implemented
    • DSTRUCT is no longer available for Delphi™ 1.0
       
  • Release 1.2   [Aug-13, 1998]
     
    • DSTRUCT is now available for Delphi™ 4.0
       
  • Release 1.1 (Apr-14, 1998)
     
    • Logic operators of CombineWith extended by loANDNot, loORNot, and loXORNot
    • new method of FIFO: ForceByte
    • RLEncoder implemented
    • NextCombination implemented
    • DSTRUCT is now available for all versions of Delphi™ (1.0, 2.0, 3.0), and for C++Builder™ (1.0 and 3.0)