Changeset 304 for Generics/TemplateGenerics/Specialized/SpecializedList.pas
- Timestamp:
- Dec 19, 2011, 9:19:00 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Specialized/SpecializedList.pas
r232 r304 90 90 TListByte = class(TListByteBase) 91 91 procedure WriteToStream(Stream: TStream); 92 procedure WriteToStreamPart(Stream: TStream; ItemIndex, ItemCount: TGListIndex); 93 procedure ReplaceStream(Stream: TStream); 94 procedure ReplaceStreamPart(Stream: TStream; ItemIndex, ItemCount: TGListIndex); 95 procedure AddStream(Stream: TStream); 96 procedure AddStreamPart(Stream: TStream; ItemCount: TGListIndex); 92 97 end; 93 98 … … 338 343 end; 339 344 345 { TListByte } 346 340 347 procedure TListByte.WriteToStream(Stream: TStream); 341 348 var 342 349 I: Integer; 343 350 begin 351 Stream.Position := 0; 344 352 I := 0; 345 while I < Count do 353 while I < Count do begin 346 354 Stream.WriteByte(Items[I]); 347 end; 348 355 I := I + 1; 356 end; 357 end; 358 359 procedure TListByte.WriteToStreamPart(Stream: TStream; ItemIndex, ItemCount: Integer); 360 var 361 I: Integer; 362 begin 363 I := ItemIndex; 364 while I < ItemCount do begin 365 Stream.WriteByte(Items[I]); 366 I := I + 1; 367 end; 368 end; 369 370 procedure TListByte.ReplaceStream(Stream: TStream); 371 var 372 I: Integer; 373 begin 374 Stream.Position := 0; 375 I := 0; 376 while I < Count do begin 377 Items[I] := Stream.ReadByte; 378 I := I + 1; 379 end; 380 end; 381 382 procedure TListByte.ReplaceStreamPart(Stream: TStream; ItemIndex, 383 ItemCount: Integer); 384 var 385 I: Integer; 386 begin 387 I := ItemIndex; 388 while I < ItemCount do begin 389 Items[I] := Stream.ReadByte; 390 I := I + 1; 391 end; 392 end; 393 394 procedure TListByte.AddStream(Stream: TStream); 395 var 396 I: Integer; 397 begin 398 Stream.Position := 0; 399 I := Count; 400 Count := Count + Stream.Size; 401 while I < Count do begin 402 Items[I] := Stream.ReadByte; 403 I := I + 1; 404 end; 405 end; 406 407 procedure TListByte.AddStreamPart(Stream: TStream; ItemCount: Integer); 408 var 409 I: Integer; 410 begin 411 I := Count; 412 Count := Count + ItemCount; 413 while I < Count do begin 414 Items[I] := Stream.ReadByte; 415 I := I + 1; 416 end; 417 end; 349 418 350 419 end.
Note:
See TracChangeset
for help on using the changeset viewer.