Changeset 4 for trunk/UShpFile.pas


Ignore:
Timestamp:
Jan 30, 2016, 12:15:16 AM (9 years ago)
Author:
chronos
Message:
  • Added: Not finished class for loading WSA files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UShpFile.pas

    r3 r4  
    66
    77uses
    8   Classes, SysUtils, Contnrs, Graphics, UFormat80, Types;
     8  Classes, SysUtils, Contnrs, Graphics, UDecode, Types;
    99
    1010type
     
    3939implementation
    4040
    41 function Format20(Source: TByteDynArray): TByteDynArray;
    42 var
    43   D: Byte;
    44   Count: Integer;
    45   SourceIndex: Integer;
    46   DestIndex: Integer;
    47 begin
    48   SourceIndex := 0;
    49   DestIndex := 0;
    50   SetLength(Result, Length(Source));
    51   while SourceIndex < Length(Source) do begin
    52     D := Source[SourceIndex];
    53     Inc(SourceIndex);
    54     if D = 0 then begin
    55       if SourceIndex >= Length(Source) then
    56         Break;
    57       Count := Source[SourceIndex];
    58       if Count = 0 then Break;
    59       Inc(SourceIndex);
    60       if (DestIndex + Count) >= Length(Result) then
    61         SetLength(Result, DestIndex + Count + 1);
    62       FillChar(Result[DestIndex], Count, 0);
    63       Inc(DestIndex, Count);
    64     end else begin
    65       if DestIndex >= Length(Result) then
    66         SetLength(Result, DestIndex + 1);
    67       Result[DestIndex] := D;
    68       Inc(DestIndex);
    69     end;
    70   end;
    71 end;
    7241
    7342{ TShpFileItem }
Note: See TracChangeset for help on using the changeset viewer.