Changeset 4 for branches/bigint/Memory.pas
- Timestamp:
- Aug 1, 2024, 10:47:04 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bigint/Memory.pas
r3 r4 21 21 procedure WritePos(Data: TInt); 22 22 function ReadPos: TInt; 23 procedure CopyFrom(Source: TMemory; Dst, Src, Count: TInt); 24 procedure WriteStringPos(Value: string); 23 25 property Size: TInt read GetSize write SetSize; 24 26 property Position: TInt read FPosition write FPosition; 27 property Items[Index: TInt]: TInt read Read write Write; default; 25 28 end; 26 29 … … 62 65 end; 63 66 67 procedure TMemory.CopyFrom(Source: TMemory; Dst, Src, Count: TInt); 68 var 69 I: Integer; 70 begin 71 for I := 0 to Count - 1 do begin 72 Write(Dst, Source.Read(Src)); 73 Inc(Dst); 74 Inc(Src); 75 end; 76 end; 77 78 procedure TMemory.WriteStringPos(Value: string); 79 var 80 I: Integer; 81 begin 82 if Length(Value) > 0 then begin 83 if Position + Length(Value) > Size then Size := Position + Length(Value); 84 for I := 0 to Length(Value) - 1 do 85 Items[Position + I] := Ord(Value[I + 1]); 86 Inc(FPosition, Length(Value)); 87 end; 88 end; 89 64 90 end. 65 91
Note:
See TracChangeset
for help on using the changeset viewer.