Changeset 425 for Generics/NativeGenerics/Units/GenericStream.pas
- Timestamp:
- Sep 21, 2012, 9:19:58 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/NativeGenerics/Units/GenericStream.pas
r323 r425 21 21 function GetPosition: TIndex; 22 22 public 23 procedure Assign(Source: TGAbstractStream<TItem>); virtual; 23 procedure Assign(Source: TGAbstractStream<TItem>); virtual; abstract; 24 24 procedure Write(Item: TItem); virtual; abstract; 25 25 procedure WriteArray(Item: array of TItem); virtual; abstract; … … 27 27 function Read: TItem; virtual; abstract; 28 28 function ReadArray(Count: TIndex): TItemArray; virtual; abstract; 29 function ReadBuffer(var Buffer; Count: Integer): Integer; virtual; abstract; 29 30 function Insert(Count: TIndex): TIndex; virtual; abstract; 30 31 function Remove(Count: TIndex): TIndex; virtual; abstract; … … 41 42 FPosition: TIndex; 42 43 public 44 type 45 PItem = ^TItem; 43 46 procedure Assign(Source: TGAbstractStream<TItem>); override; 44 47 procedure Write(Item: TItem); override; … … 48 51 function ReadArray(Count: TIndex): TItemArray; override; 49 52 function ReadList(List: TGList<TItem>; Count: TIndex): TIndex; 53 function ReadBuffer(var Buffer; Count: Integer): Integer; override; 50 54 function Insert(Count: TIndex): Integer; override; 51 55 function Remove(Count: TIndex): Integer; override; … … 56 60 end; 57 61 62 TStreamByte = TGStream<Byte>; 63 58 64 59 65 implementation … … 61 67 62 68 { TGStream } 63 64 procedure TGAbstractStream<TItem>.Assign(Source: TGAbstractStream<TItem>);65 begin66 end;67 69 68 70 procedure TGAbstractStream<TItem>.SetPosition(AValue: TIndex); … … 112 114 procedure TGStream<TItem>.Assign(Source: TGAbstractStream<TItem>); 113 115 begin 114 inherited;115 116 if Source is TGStream<TItem> then begin 116 117 FList.Assign(TGStream<TItem>(Source).FList); … … 196 197 end; 197 198 199 function TGStream<TItem>.ReadBuffer(var Buffer; Count: Integer): Integer; 200 begin 201 List.GetBuffer(Position, Buffer, Count); 202 end; 203 198 204 199 205 end.
Note:
See TracChangeset
for help on using the changeset viewer.