Changeset 25


Ignore:
Timestamp:
May 14, 2010, 7:12:13 AM (15 years ago)
Author:
george
Message:
  • Přidáno: Třída TStringListEx rozšiřující možnosti třídy TStringList.
  • Přidáno: Třída AppliactionInfo.
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • MemoryStreamEx/UMemoryStreamEx.pas

    r16 r25  
    6060  StringLength: Longint;
    6161begin
    62   Read(StringLength, SizeOf(StringLength));
     62  ReadBuffer(StringLength, SizeOf(StringLength));
    6363  SetLength(Result, StringLength);
    6464  if StringLength > 0 then begin
    65     Read(Result[1], StringLength);
     65    ReadBuffer(Result[1], StringLength);
    6666  end;
    6767end;
     
    6969function TMemoryStreamEx.ReadByte: Byte;
    7070begin
    71   Read(Result, SizeOf(Byte));
     71  ReadBuffer(Result, SizeOf(Byte));
    7272end;
    7373
    7474function TMemoryStreamEx.ReadCardinal: Cardinal;
    7575begin
    76   Read(Result, SizeOf(Cardinal));
     76  ReadBuffer(Result, SizeOf(Cardinal));
    7777  if SwapData then Result := Swap(Result);
    7878end;
     
    8080function TMemoryStreamEx.ReadInt64: Int64;
    8181begin
    82   Read(Result, SizeOf(Int64));
     82  ReadBuffer(Result, SizeOf(Int64));
    8383  if SwapData then Result := Swap(Result);
    8484end;
     
    8888  Count: Byte;
    8989begin
    90   Read(Count, 1);
     90  ReadBuffer(Count, 1);
    9191  SetLength(Result, Count);
    92   Read(Result[1], Count);
     92  ReadBuffer(Result[1], Count);
    9393end;
    9494
     
    9999  if Count > 0 then begin
    100100    SetLength(Buffer, Count);
    101     Read(Buffer[0], Count);
     101    ReadBuffer(Buffer[0], Count);
    102102    Stream.Size := Count;
    103103    Stream.Position := 0;
     
    118118function TMemoryStreamEx.ReadDouble: Double;
    119119begin
    120   Read(Result, SizeOf(Double));
     120  ReadBuffer(Result, SizeOf(Double));
    121121end;
    122122
    123123function TMemoryStreamEx.ReadSingle: Single;
    124124begin
    125   Read(Result, SizeOf(Single));
     125  ReadBuffer(Result, SizeOf(Single));
    126126end;
    127127
    128128function TMemoryStreamEx.ReadWord: Word;
    129129begin
    130   Read(Result, SizeOf(Word));
     130  ReadBuffer(Result, SizeOf(Word));
    131131  if SwapData then Result := Swap(Result);
    132132end;
Note: See TracChangeset for help on using the changeset viewer.