mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
* TRegistryIniFile: Fixed uninitialized Result in ValueExists(). Implemented SectionExists().
git-svn-id: trunk@48206 -
This commit is contained in:
parent
9fd0f94d7c
commit
2c196ee8a9
@ -266,6 +266,7 @@ type
|
|||||||
procedure DeleteKey(const Section, Name: String); override;
|
procedure DeleteKey(const Section, Name: String); override;
|
||||||
procedure UpdateFile; override;
|
procedure UpdateFile; override;
|
||||||
function ValueExists(const Section, Ident: string): Boolean; override;
|
function ValueExists(const Section, Ident: string): Boolean; override;
|
||||||
|
function SectionExists(const Section: string): Boolean; override;
|
||||||
property RegIniFile: TRegIniFile read FRegIniFile;
|
property RegIniFile: TRegIniFile read FRegIniFile;
|
||||||
end{$ifdef XMLREG}deprecated 'Use TRegistry instead. Will be removed in 4.0'{$endif} platform;
|
end{$ifdef XMLREG}deprecated 'Use TRegistry instead. Will be removed in 4.0'{$endif} platform;
|
||||||
|
|
||||||
@ -1125,13 +1126,18 @@ end;
|
|||||||
|
|
||||||
function TRegistryIniFile.ValueExists(const Section, Ident: string): Boolean;
|
function TRegistryIniFile.ValueExists(const Section, Ident: string): Boolean;
|
||||||
begin
|
begin
|
||||||
with FRegInifile do
|
Result:=FRegInifile.OpenSection(Section);
|
||||||
if OpenSection(Section) then
|
if Result then
|
||||||
try
|
try
|
||||||
Result:=FRegInifile.ValueExists(Ident);
|
Result:=FRegInifile.ValueExists(Ident);
|
||||||
finally
|
finally
|
||||||
CloseSection;
|
FRegInifile.CloseSection;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRegistryIniFile.SectionExists(const Section: string): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=FRegIniFile.KeyExists(Section);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef XMLREG}
|
{$ifdef XMLREG}
|
||||||
|
Loading…
Reference in New Issue
Block a user