Sfoglia il codice sorgente

utlMCF: Clear() and Assign() methods

master
Martok 11 anni fa
parent
commit
4f8bfeead9
1 ha cambiato i file con 24 aggiunte e 0 eliminazioni
  1. +24
    -0
      uutlMCF.pas

+ 24
- 0
uutlMCF.pas Vedi File

@@ -73,6 +73,8 @@ type
destructor Destroy; override;

function GetEnumerator: TSectionEnumerator;
procedure Clear;
procedure Assign(Source: TutlMCFSection);

property ValueCount: integer read GetValueCount;
property ValueNameAt[Index: integer]: string read GetValueName;
@@ -294,6 +296,28 @@ begin
result := TSectionEnumerator.Create(FSections);
end;

procedure TutlMCFSection.Clear;
begin
ClearSections;
ClearValues;
end;

procedure TutlMCFSection.Assign(Source: TutlMCFSection);
var
ms: TMemoryStream;
begin
Clear;
ms:= TMemoryStream.Create;
try
Source.SaveData(ms, '', leNone);
ms.Position:= 0;
LoadData(ms, leNone, 0);
finally
FreeAndNil(ms);
end;
end;


function TutlMCFSection.GetSectionCount: integer;
begin
Result:= FSections.Count;


Caricamento…
Annulla
Salva