2013-12-19 19:32:50 +01:00

1775 lines
47 KiB
ObjectPascal

{
****************************************************************************
| YCFG Unit Version 2.00 |
| |
| Copyright (c) 2006 by Yeminy |
| Copyright (c) 2006 by Rylon |
| |
| 151 Function/Procedures |
| |
| 151 Done : 0 ToDo >>> 100,00% Done : 0,00% ToDO |
| |
| 4 Tested : 151 ToDo >>> 0,00% Done : 100,00% ToDo |
| |
****************************************************************************
****************************************************************************
| License: |
| |
****************************************************************************
****************************************************************************
| ToDo: Falls es viele Keys gibt, alle in einer Liste ausgeben |
| Bsp: test=2135123 |
| test=213ds435dsf |
| |
****************************************************************************
****************************************************************************
| ChangeLog: |
| -started project ycfg 2 |
****************************************************************************
}
unit ycfg;
interface
uses SysUtils, Classes, windows, Graphics, ycode;
// OTHER************************************************************************************************************************* //--
//--
//sections //--
function setYcfgSections(YcfgFile,Sections:string;OverrideExisting:boolean):boolean; overload; //w
function setYcfgSections(var YcfgFile:TStringlist;Sections:string;OverrideExisting:boolean):boolean; overload; //w
function setYcfgSections(YcfgFile:string;Sections:TStringList;OverrideExisting:boolean):boolean; overload; //w
function setYcfgSections(var YcfgFile,Sections:TStringlist;OverrideExisting:boolean):boolean; overload; //w
//--
function setYcfgSection(YcfgFile,Section,Value:string;OverrideExisting:boolean):boolean; overload; //w
function setYcfgSection(var YcfgFile:TStringList;Section,Value:string;OverrideExisting:boolean):boolean; overload; //w
function setYcfgSection(YcfgFile,Section:string;Value:TStringList;OverrideExisting:Boolean):boolean; overload; //w
function setYcfgSection(var YcfgFile:TStringlist;Section:string;Value:TStringList;OverrideExisting:Boolean):boolean; overload; //w
//--
// Add*************************************************************************************************************************** //--
//--
//global //--
//procedure addYcfgSpaceLine(YcfgFile:string); overload; //
//procedure addYcfgSpaceLine(var YcfgFile:Tstringlist); overload; //
//procedure addYcfgSpaceLine(YcfgFile:string;Position:integer); overload; //
//procedure addYcfgSpaceLine(var YcfgFile:Tstringlist;Position:integer); overload; //
//Section //--
//procedure addYcfgSecSpaceLine(YcfgFile,Section:string); overload; //
//procedure addYcfgSecSpaceLine(var YcfgFile:Tstringlist;Section:string;); overload; //
//procedure addYcfgSecSpaceLine(YcfgFile,Section:string;Position:integer); overload; //
//procedure addYcfgSecSpaceLine(var YcfgFile:Tstringlist;Section:string;Position:integer); overload; //
//--
//gloabl //--
//procedure addYcfgComment(YcfgFile,Value:string); overload; //
//procedure addYcfgComment(var YcfgFile:Tstringlist;Value:string); overload; //
//procedure addYcfgComment(YcfgFile:string;Position:integer;Value:string); overload; //
//procedure addYcfgComment(var YcfgFile:Tstringlist;Position:integer;Value:string); overload; //
//Section //--
//procedure addYcfgSecComment(YcfgFile,Section,Value:string); overload; //
//procedure addYcfgSecComment(var YcfgFile:Tstringlist;Section,Value:string); overload; //
//procedure addYcfgSecComment(YcfgFile,Section:string;Position:integer;Value:string); overload; //
//procedure addYcfgSecComment(var YcfgFile:Tstringlist;Section:string;Position:integer;Value:string); overload; //
implementation
function isStringIncluded(SourceString,SearchString,DivideParam:String):boolean; overload;
var i:Integer;
begin
Result:=False;
for i:=1 to getStringDivides(SourceString,DivideParam) do
begin
if DivideAString(SourceString,DivideParam,i)=SearchString then
begin
Result:=true;
Exit;
end;
end;
end;
function isStringIncluded(SourceString,SearchString:String):boolean; overload;
begin
Result:=isStringIncluded(SourceString,SearchString,StringDivideParam);
end;
function DivideAString(SourceString,DivideParam:string;Position:integer):string; overload;
var i:integer;
lastDivide:Integer;
dividecount:Integer;
begin
Result:='';
if getStringDivides(SourceString,DivideParam)<=0 then Exit;
lastDivide:=1;
dividecount:=0;
for i:=1 to length(SourceString) do
begin
if LowerCase(copy(SourceString,i,Length(DivideParam)))=LowerCase(DivideParam) then
begin
Inc(dividecount);
if Position=dividecount then
begin
Result:=Copy(SourceString,lastdivide,i-lastdivide);
Exit;
end;
lastDivide:=i+length(DivideParam);
end;
end;
if dividecount>=Position-1 then Result:=Copy(SourceString,lastdivide,Length(SourceString));
end;
function DivideAString(SourceString:string;Position:integer):string; overload;
begin
Result:=DivideAString(SourceString,StringDivideParam,Position);
end;
function getStringDivides(SourceString,DivideParam:string):integer; overload;
var i:integer;
begin
Result:=0;
if Length(SourceString)<=0 then Exit;
for i:=1 to length(SourceString) do
begin
if LowerCase(Copy(SourceString,i,Length(DivideParam)))=LowerCase(DivideParam) then Inc(Result);
end;
if LowerCase(Copy(SourceString,Length(SourceString)-length(DivideParam)+1,length(DivideParam)))<>LowerCase(DivideParam) then Inc(Result);
end;
function getStringDivides(SourceString:string):integer; overload;
begin
Result:=getStringDivides(SourceString,StringDivideParam);
end;
function getYcfgSections(YcfgFile:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSections(sl);
sl.Free;
end;
function getYcfgSections(YcfgFile:TStringlist):TStringList; overload;
var i:Integer;
begin
Result:=TStringList.Create;
for i:=0 to YcfgFile.Count-1 do
begin
if LowerCase(Copy(YcfgFile.Strings[i],1,Length(YcfgSectionInit)))=LowerCase(YcfgSectionInit) then Result.Add(copy(DivideAString(YcfgFile.strings[i],']',1),2,Length(YcfgFile.strings[i])));
end;
end;
function getYcfgSection(YcfgFile,Section:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSection(sl,Section);
sl.Free;
end;
function getYcfgSection(YcfgFile:TStringlist;Section:string):TStringList; overload;
var i:Integer;
check:Boolean;
begin
Result:=TStringList.Create;
check:=False;
for i:=0 to YcfgFile.Count-1 do
begin
if (LowerCase(Copy(YcfgFile.Strings[i],1,Length(YcfgSectionInit+Section+YcfgSectionEnd)))=LowerCase(YcfgSectionInit+Section+YcfgSectionEnd)) and not check then check:=True;
if (LowerCase(Copy(YcfgFile.Strings[i],1,Length(YcfgSectionInit)))=LowerCase(YcfgSectionInit)) and check then check:=false else
if check then Result.Add(YcfgFile.Strings[i]);
end;
end;
function getYcfgSectionText(YcfgFile,Section:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSectionText(sl,Section);
sl.Free;
end;
function getYcfgSectionText(YcfgFile:TStringlist;Section:string):TStringList; overload;
begin
Result:=getYcfgSection(YcfgFile,Section);
Result.Delete(0);
end;
function getYcfgSectionKeys(YcfgFile,Section,DivideParam:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if fileexists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSectionKeys(sl,Section,DivideParam);
sl.Free;
end;
function getYcfgSectionKeys(YcfgFile,Section:string):TStringList; overload;
begin
Result:=getYcfgSectionKeys(YcfgFile,Section,YcfgDivideParam);
end;
function getYcfgSectionKeys(YcfgFile:TStringlist;Section,DivideParam:string):TStringList; overload;
var sl:TStringList;
i,j:Integer;
check:Boolean;
begin
Result:=TStringList.Create;
sl:=TStringList.Create;
sl:=getYcfgSection(YcfgFile,Section);
for i:=0 to sl.count-1 do
begin
check:=False;
for j:=1 to Length(sl.Strings[i]) do
begin
if LowerCase(Copy(sl.Strings[i],j,Length(DivideParam)))=LowerCase(DivideParam) then check:=True;
end;
if check then Result.Add(DivideAString(sl.Strings[i],DivideParam,1));
end;
sl.Free;
end;
function getYcfgSectionKeys(YcfgFile:TStringlist;Section:string):TStringList; overload;
begin
Result:=getYcfgSectionKeys(YcfgFile,Section,YcfgDivideParam);
end;
function getYcfgSectionValues(YcfgFile,Section,DivideParam:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSectionValues(sl,Section,DivideParam);
sl.Free;
end;
function getYcfgSectionValues(YcfgFile,Section:string):TStringList; overload;
begin
Result:=getYcfgSectionValues(YcfgFile,Section,YcfgDivideParam);
end;
function getYcfgSectionValues(YcfgFile:TStringlist;Section,DivideParam:string):TStringList; overload;
var sl:TStringList;
i,j:Integer;
check:Boolean;
begin
Result:=TStringList.Create;
sl:=TStringList.Create;
sl:=getYcfgSection(YcfgFile,Section);
for i:=0 to sl.count-1 do
begin
check:=False;
for j:=1 to Length(sl.Strings[i]) do
begin
if LowerCase(Copy(sl.Strings[i],j,Length(DivideParam)))=LowerCase(DivideParam) then check:=True;
end;
if check then Result.Add(DivideAString(sl.Strings[i],DivideParam,2));
end;
sl.Free;
end;
function getYcfgSectionValues(YcfgFile:TStringlist;Section:string):TStringList; overload;
begin
Result:=getYcfgSectionValues(YcfgFile,Section,YcfgDivideParam);
end;
function getYcfgSectionNoKeys(YcfgFile,Section,DivideParam:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSectionNoKeys(sl,Section,DivideParam);
sl.Free;
end;
function getYcfgSectionNoKeys(YcfgFile,Section:string):TStringList; overload;
begin
Result:=getYcfgSectionNoKeys(YcfgFile,Section,YcfgDivideParam);
end;
function getYcfgSectionNoKeys(YcfgFile:TStringlist;Section,DivideParam:string):TStringList; overload;
var sl:TStringList;
i,j:Integer;
check:boolean;
begin
Result:=TStringList.Create;
sl:=TStringList.Create;
sl:=getYcfgSection(YcfgFile,Section);
for i:=0 to sl.count-1 do
begin
check:=False;
for j:=1 to Length(sl.Strings[i]) do
begin
if LowerCase(Copy(sl.Strings[i],j,Length(DivideParam)))=LowerCase(DivideParam) then check:=True;
end;
if not check then Result.Add(sl.Strings[i]);
end;
sl.Free;
end;
function getYcfgSectionNoKeys(YcfgFile:TStringlist;Section:string):TStringList; overload;
begin
Result:=getYcfgSectionNoKeys(YcfgFile,Section,YcfgDivideParam);
end;
procedure createYcfgSection(YcfgFile,Section:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
createYcfgSection(sl,Section);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure createYcfgSection(var YcfgFile:TStringlist;Section:string); overload;
var sl:TStringList;
i:integer;
begin
sl:=TStringList.Create;
sl:=getYcfgSections(YcfgFile);
for i:=0 to sl.Count-1 do
if LowerCase(sl.Strings[i])=LowerCase(Section) then Exit;
YcfgFile.Add(YcfgSectionInit+Section+YcfgSectionEnd);
sl.Free;
end;
procedure delYcfgSection(YcfgFile,Section:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
delYcfgSection(sl,Section);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure delYcfgSection(var YcfgFile:TStringlist;Section:string); overload;
var Point:TPoint;
i:Integer;
begin
Point:=getYcfgSectionPos(YcfgFile,Section);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then Exit;
for i:=0 to Point.Y-Point.X do YcfgFile.Delete(Point.X);
end;
function getYcfgListPos(YcfgFile,ListHeader:string):TPoint; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgListPos(sl,ListHeader);
sl.Free;
end;
function getYcfgListPos(YcfgFile:TStringlist;ListHeader:string):TPoint; overload;
var i:Integer;
check:Boolean;
begin
Result.X:=-1;
Result.Y:=-1;
check:=False;
for i:=0 to YcfgFile.Count-1 do
begin
if (LowerCase(Copy(YcfgFile.Strings[i],1,Length(ListHeader)))=LowerCase(ListHeader)) and not check then
begin
Result.X:=i;
check:=True;
end else
if (LowerCase(Copy(YcfgFile.Strings[i],1,Length(ListHeader)))=LowerCase(ListHeader)) and check then
begin
Result.Y:=i;
check:=True;
end;
end;
end;
function getYcfgSectionPos(YcfgFile,Section:string):TPoint; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSectionPos(sl,Section);
sl.Free;
end;
function getYcfgSectionPos(YcfgFile:TStringlist;Section:string):TPoint; overload;
var i:Integer;
check:boolean;
begin
Result.X:=-1;
Result.Y:=-1;
check:=False;
for i:=0 to YcfgFile.Count-1 do
begin
if (LowerCase(Copy(YcfgFile.Strings[i],1,Length(YcfgSectionInit+Section+YcfgSectionEnd)))=LowerCase(YcfgSectionInit+Section+YcfgSectionEnd)) and not check then
begin
check:=True;
result.X:=i;
end;
if (LowerCase(Copy(YcfgFile.Strings[i],1,Length(YcfgSectionInit)))=LowerCase(YcfgSectionInit)) and check then
begin
check:=false;
Result.Y:=i-1;
end;
end;
if Result.Y<Result.X then result.Y:=YcfgFile.Count-1;
end;
procedure clearYcfgSection(YcfgFile,Section:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
clearYcfgSection(sl,Section);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure clearYcfgSection(var YcfgFile:TStringlist;Section:string); overload;
var Point:TPoint;
i:Integer;
begin
Point:=getYcfgSectionPos(YcfgFile,Section);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then Exit;
for i:=0 to Point.Y-Point.X-1 do YcfgFile.Delete(Point.X+1);
end;
function YcfgSectionExists(YcfgFile,Section:string):boolean; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=YcfgSectionExists(sl,Section);
sl.Free;
end;
function YcfgSectionExists(var YcfgFile:TStringlist;Section:string):boolean; overload;
var sl:TStringList;
i:Integer;
begin
Result:=false;
sl:=TStringList.Create;
sl:=getYcfgSections(YcfgFile);
for i:=0 to sl.Count-1 do
if LowerCase(sl.Strings[i])=LowerCase(Section) then Result:=True;
sl.Free;
end;
function readYcfgHeader(YcfgFile:string):string; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=readYcfgHeader(sl);
sl.Free;
end;
function readYcfgHeader(YcfgFile:TStringlist):string; overload;
begin
Result:='';
if YcfgFile.Count>0 then
if Copy(YcfgFile.Strings[0],1,2)='$$' then Result:=YcfgFile.Strings[0];
end;
function checkYcfgHeader(YcfgFile:string):boolean; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=checkYcfgHeader(sl);
sl.Free;
end;
function checkYcfgHeader(YcfgFile:TStringlist):boolean; overload;
begin
Result:=false;
if YcfgFile.Count>0 then
if LowerCase(YcfgFile.Strings[0])=LowerCase(YcfgHeader) then Result:=true;
end;
procedure writeYcfgHeader(YcfgFile:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
writeYcfgHeader(sl);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure writeYcfgHeader(YcfgFile:TStringlist); overload;
begin
if readYcfgHeader(YcfgFile)<>'' then YcfgFile.Insert(0,YcfgHeader) else YcfgFile.Strings[0]:=YcfgHeader;
end;
function getYcfgVersion:string;
begin
Result:=YcfgVersion;
end;
procedure clearYcfgList(YcfgFile,ListHeader:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
clearYcfgList(sl,ListHeader);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure clearYcfgList(var YcfgFile:TStringlist;ListHeader:string); overload;
var Point:TPoint;
i:Integer;
begin
Point:=getYcfgListPos(YcfgFile,ListHeader);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then Exit;
for i:=0 to Point.Y-Point.X-2 do YcfgFile.Delete(Point.X+1);
if LowerCase(YcfgFile[Point.X+1])<>LowerCase(ListHeader) then YcfgFile[Point.X+1]:=ListHeader;
end;
procedure delYcfgList(YcfgFile,ListHeader:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
delYcfgList(sl,ListHeader);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure delYcfgList(var YcfgFile:TStringlist;ListHeader:string); overload;
var Point:TPoint;
i:Integer;
begin
Point:=getYcfgListPos(YcfgFile,ListHeader);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then Exit;
for i:=0 to Point.Y-Point.X do YcfgFile.Delete(Point.X);
end;
function YcfgListExists(YcfgFile,ListHeader:string):boolean; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
YcfgListExists(sl,ListHeader);
sl.Free;
end;
function YcfgListExists(YcfgFile:TStringlist;ListHeader:string):boolean; overload;
var i:Integer;
Point:TPoint;
begin
Result:=False;
Point:=getYcfgListPos(YcfgFile,ListHeader);
if (Point.X>-1) and (Point.Y>-1) then Result:=True;
end;
function getYcfgList(YcfgFile,ListHeader:string):TStringList; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgList(sl,ListHeader);
sl.Free;
end;
function getYcfgList(YcfgFile:TStringlist;ListHeader:string):TStringList; overload;
var i:Integer;
Point:TPoint;
begin
Result:=TStringList.Create;
Point:=getYcfgListPos(YcfgFile,ListHeader);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then Exit;
for i:=0 to Point.Y-Point.X-2 do Result.Add(YcfgFile.Strings[Point.x+1+i]);
if LowerCase(YcfgFile[Point.Y])<>LowerCase(ListHeader) then Result.Add(YcfgFile[Point.Y]);
end;
function setYcfgList(YcfgFile,ListHeader:string;List:TStringList;OverrideExisting:boolean):Boolean; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=setYcfgList(sl,ListHeader,List,OverrideExisting);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
function setYcfgList(var YcfgFile:TStringlist;ListHeader:string;List:TStringList;OverrideExisting:boolean):Boolean; overload;
var Point:TPoint;
i:Integer;
begin
Result:=false;
Point:=getYcfgListPos(YcfgFile,ListHeader);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then
begin
YcfgFile.Add(ListHeader);
for i:=0 to List.Count-1 do YcfgFile.Add(List.Strings[i]);
YcfgFile.Add(ListHeader);
Result:=True;
end else
if OverrideExisting then
begin
clearYcfgList(YcfgFile,ListHeader);
for i:=List.Count-1 downto 0 do YcfgFile.Insert(Point.X,List.Strings[i]);
Result:=True;
end;
end;
procedure addYcfgListStr(YcfgFile,ListHeader,Value:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
addYcfgListStr(sl,ListHeader,Value);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure addYcfgListStr(var YcfgFile:TStringlist;ListHeader,Value:string); overload;
var point:TPoint;
begin
point:=getYcfgListPos(YcfgFile,ListHeader);
if (point.X=-1) or (Point.Y=-1) or (Point.Y<Point.Y) then
begin
YcfgFile.Add(ListHeader);
YcfgFile.Add(Value);
YcfgFile.Add(ListHeader);
end else YcfgFile.Insert(Point.Y-1,Value);
end;
procedure addYcfgListInt(YcfgFile,ListHeader:string;Value:integer); overload;
begin
addYcfgListStr(YcfgFile,ListHeader,IntToStr(Value));
end;
procedure addYcfgListInt(var YcfgFile:TStringlist;ListHeader:string;Value:integer); overload;
begin
addYcfgListStr(YcfgFile,ListHeader,IntToStr(Value));
end;
procedure addYcfgListComment(YcfgFile,ListHeader:string;Value:string); overload;
begin
addYcfgListStr(YcfgFile,ListHeader,DivideAString(YcfgComments,' ',1)+Value);
end;
procedure addYcfgListComment(var YcfgFile:TStringlist;ListHeader:string;Value:string); overload;
begin
addYcfgListStr(YcfgFile,ListHeader,DivideAString(YcfgComments,' ',1)+Value);
end;
procedure addYcfgListBool(YcfgFile,ListHeader:string;Value:boolean); overload;
begin
addYcfgListStr(YcfgFile,ListHeader,BoolToStr(Value));
end;
procedure addYcfgListBool(var YcfgFile:TStringlist;ListHeader:string;Value:boolean); overload;
begin
addYcfgListStr(YcfgFile,ListHeader,BoolToStr(Value));
end;
procedure addYcfgList(YcfgFile,ListHeader:string;Value:TStringList); overload;
var i:Integer;
begin
for i:=0 to Value.Count-1 do addYcfgListStr(YcfgFile,ListHeader,Value.Strings[i]);
end;
procedure addYcfgList(var YcfgFile:TStringlist;ListHeader:string;Value:TStringList); overload;
var i:Integer;
begin
for i:=0 to Value.Count-1 do addYcfgListStr(YcfgFile,ListHeader,Value.Strings[i]);
end;
function getYcfgStr(YcfgFile,SearchString,DivideParam:string):string; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgStr(sl,SearchString,DivideParam);
sl.Free;
end;
function getYcfgStr(YcfgFile,SearchString:string):string; overload;
begin
Result:=getYcfgStr(YcfgFile,SearchString,YcfgDivideParam);
end;
function getYcfgStr(YcfgFile:TStringlist;SearchString,DivideParam:string):string; overload;
var i:Integer;
begin
Result:='';
for i:=0 to YcfgFile.Count-1 do
if LowerCase(DivideAString(YcfgFile.Strings[i],DivideParam,1))=LowerCase(SearchString) then Result:=Copy(YcfgFile.Strings[i],Length(DivideAString(YcfgFile.Strings[i],DivideParam,2))+1,Length(YcfgFile.Strings[i]));
end;
function getYcfgStr(YcfgFile:Tstringlist;SearchString:string):string; overload;
begin
Result:=getYcfgStr(YcfgFile,Searchstring,YcfgDivideParam);
end;
function getYcfgSecStr(YcfgFile,Section,SearchString,DivideParam:string):string; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSecStr(sl,Section,SearchString,DivideParam);
sl.Free;
end;
function getYcfgSecStr(YcfgFile,Section,SearchString:string):string; overload;
begin
Result:=getYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam);
end;
function getYcfgSecStr(YcfgFile:TStringlist;Section,SearchString,DivideParam:string):string; overload;
var sl:TStringList;
i:Integer;
begin
Result:='';
sl:=getYcfgSection(YcfgFile,Section);
for i:=0 to sl.Count-1 do
if LowerCase(DivideAString(sl.Strings[i],DivideParam,1))=LowerCase(SearchString) then Result:=Copy(sl.Strings[i],Length(DivideAString(sl.Strings[i],DivideParam,2))+1,Length(sl.Strings[i]));
sl.Free;
end;
function getYcfgSecStr(YcfgFile:Tstringlist;Section,SearchString:string):string; overload;
begin
Result:=getYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam);
end;
function getYcfgInt(YcfgFile,SearchString,DivideParam:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgStr(YcfgFile,SearchString,DivideParam),DefaultValue);
end;
function getYcfgInt(YcfgFile,SearchString:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgStr(YcfgFile,SearchString,YcfgDivideParam),DefaultValue);
end;
function getYcfgInt(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgStr(YcfgFile,SearchString,DivideParam),DefaultValue);
end;
function getYcfgInt(YcfgFile:TStringlist;SearchString:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgStr(YcfgFile,SearchString,YcfgDivideParam),DefaultValue);
end;
function getYcfgSecInt(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgSecStr(YcfgFile,Section,SearchString,DivideParam),DefaultValue);
end;
function getYcfgSecInt(YcfgFile,Section,SearchString:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam),DefaultValue);
end;
function getYcfgSecInt(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgSecStr(YcfgFile,Section,SearchString,DivideParam),DefaultValue);
end;
function getYcfgSecInt(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:integer):integer; overload;
begin
Result:=StrToIntDef(getYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam),DefaultValue);
end;
function getYcfgBool(YcfgFile,SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgStr(YcfgFile,SearchString,DivideParam),DefaultValue);
end;
function getYcfgBool(YcfgFile,SearchString:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgStr(YcfgFile,SearchString,YcfgDivideParam),DefaultValue);
end;
function getYcfgBool(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgStr(YcfgFile,SearchString,DivideParam),DefaultValue);
end;
function getYcfgBool(YcfgFile:TStringlist;SearchString:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgStr(YcfgFile,SearchString,YcfgDivideParam),DefaultValue);
end;
function getYcfgSecBool(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgSecStr(YcfgFile,Section,Searchstring,DivideParam),DefaultValue);
end;
function getYcfgSecBool(YcfgFile,Section,SearchString:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgSecStr(YcfgFile,Section,Searchstring,YcfgDivideParam),DefaultValue);
end;
function getYcfgSecBool(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgSecStr(YcfgFile,Section,Searchstring,DivideParam),DefaultValue);
end;
function getYcfgSecBool(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:boolean):boolean; overload;
begin
Result:=StrToBoolDef(getYcfgSecStr(YcfgFile,Section,Searchstring,YcfgDivideParam),DefaultValue);
end;
function getYcfgFont(YcfgFile,SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgFont(sl,SearchString,DivideParam,DefaultValue);
sl.Free;
end;
function getYcfgFont(YcfgFile,SearchString:string;DefaultValue:TFont):TFont; overload;
begin
Result:=getYcfgFont(YcfgFile,SearchString,YcfgDivideParam,DefaultValue);
end;
function getYcfgFont(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload;
var values:string;
begin
Result:=TFont.Create;
values:=getYcfgStr(YcfgFile,SearchString,DivideParam);
if getStringDivides(values)<5 then
begin
Result:=DefaultValue;
Exit;
end;
Result.Charset:=StrToIntDef(DivideAString(values,1),DefaultValue.Charset);
Result.Color:=StrToIntDef(DivideAString(values,2),DefaultValue.Color);
Result.Name:=DivideAString(values,3);
Result.Size:=StrToIntDef(DivideAString(values,4),DefaultValue.Size);
Result.Pitch:=TFontPitch(StrToIntDef(DivideAString(values,5),Integer(DefaultValue.Pitch)));
if Result.Name='' then Result.Name:=DefaultValue.Name;
end;
function getYcfgFont(YcfgFile:TStringlist;SearchString:string;DefaultValue:TFont):TFont; overload;
begin
Result:=getYcfgFont(YcfgFile,SearchString,YcfgDivideParam,DefaultValue);
end;
function getYcfgSecFont(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=getYcfgSecFont(sl,Section,SearchString,DivideParam,DefaultValue);
sl.Free;
end;
function getYcfgSecFont(YcfgFile,Section,SearchString:string;DefaultValue:TFont):TFont; overload;
begin
Result:=getYcfgSecFont(YcfgFile,Section,SearchString,YcfgDivideParam,DefaultValue);
end;
function getYcfgSecFont(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload;
var values:string;
begin
Result:=TFont.Create;
values:=getYcfgSecStr(YcfgFile,Section,SearchString,DivideParam);
if getStringDivides(values)<5 then
begin
Result:=DefaultValue;
Exit;
end;
Result.Charset:=StrToIntDef(DivideAString(values,1),DefaultValue.Charset);
Result.Color:=StrToIntDef(DivideAString(values,2),DefaultValue.Color);
Result.Name:=DivideAString(values,3);
Result.Size:=StrToIntDef(DivideAString(values,4),DefaultValue.Size);
Result.Pitch:=TFontPitch(StrToIntDef(DivideAString(values,5),Integer(DefaultValue.Pitch)));
if Result.Name='' then Result.Name:=DefaultValue.Name;
end;
function getYcfgSecFont(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:TFont):TFont; overload;
begin
Result:=getYcfgSecFont(YcfgFile,Section,SearchString,YcfgDivideParam,DefaultValue);
end;
function getYcfgStrDeCrypted(YcfgFile,SearchString,DivideParam,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgStr(YcfgFile,SearchString,Divideparam));
end;
function getYcfgStrDeCrypted(YcfgFile,SearchString,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgStr(YcfgFile,SearchString,YcfgDivideparam));
end;
function getYcfgStrDeCrypted(YcfgFile:TStringlist;SearchString,DivideParam,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgStr(YcfgFile,SearchString,Divideparam));
end;
function getYcfgStrDeCrypted(YcfgFile:Tstringlist;SearchString,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgStr(YcfgFile,SearchString,YcfgDivideparam));
end;
function getYcfgSecStrDeCrypted(YcfgFile,Section,SearchString,DivideParam,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgSecStr(YcfgFile,SearchString,Divideparam));
end;
function getYcfgSecStrDeCrypted(YcfgFile,Section,SearchString,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgSecStr(YcfgFile,SearchString,YcfgDivideParam));
end;
function getYcfgSecStrDeCrypted(YcfgFile:TStringlist;Section,SearchString,DivideParam,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgSecStr(YcfgFile,SearchString,Divideparam));
end;
function getYcfgSecStrDeCrypted(YcfgFile:Tstringlist;Section,SearchString,Key:string):string; overload;
begin
Result:=DecryptStr(Key,getYcfgSecStr(YcfgFile,SearchString,YcfgDivideParam));
end;
function setYcfgSections(YcfgFile,Sections:string;OverrideExisting:boolean):boolean; overload;
var sl:TStringList;
i:Integer;
begin
sl:=TStringList.Create;
for i:=1 to getStringDivides(Sections,#13) do sl.Add(DivideAString(Sections,#13,i));
Result:=setYcfgSections(YcfgFile,sl,OverrideExisting);
sl.Free;
end;
function setYcfgSections(var YcfgFile:TStringlist;Sections:string;OverrideExisting:boolean):boolean; overload;
var sl:TStringList;
i:Integer;
begin
sl:=TStringList.Create;
for i:=1 to getStringDivides(Sections,#13) do sl.Add(DivideAString(Sections,#13,i));
Result:=setYcfgSections(YcfgFile,sl,OverrideExisting);
sl.Free;
end;
function setYcfgSections(YcfgFile:string;Sections:TStringList;OverrideExisting:boolean):boolean; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=setYcfgSections(sl,Sections,OverrideExisting);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
function setYcfgSections(var YcfgFile,Sections:TStringlist;OverrideExisting:boolean):boolean; overload;
var sl,sl2:TStringList;
i,j:Integer;
check:Boolean;
begin
sl:=TStringList.Create;
sl:=getYcfgSections(YcfgFile);
if OverrideExisting then
begin
for i:=0 to sl.Count-1 do delYcfgSection(YcfgFile,sl.Strings[i]);
for i:=0 to Sections.Count-1 do setYcfgSection(YcfgFile,Sections.Strings[i],'',True);
end else
begin
sl2:=TStringList.Create;
for i:=0 to Sections.Count-1 do
if not YcfgSectionExists(YcfgFile,Sections.Strings[i]) then sl2.Add(Sections.Strings[i]);
for i:=0 to sl.Count-1 do
begin
check:=true;
for j:=0 to Sections.Count-1 do
if LowerCase(sl.Strings[i])=LowerCase(Sections.Strings[j]) then check:=false;
if check then delYcfgSection(YcfgFile,sl.Strings[i]);
end;
for i:=0 to sl2.Count-1 do setYcfgSection(YcfgFile,sl2.Strings[i],'',True);
end;
end;
function setYcfgSection(YcfgFile,Section,Value:string;OverrideExisting:boolean):boolean; overload;
var sl:TStringList;
i:Integer;
begin
sl:=TStringList.Create;
for i:=1 to getStringDivides(Value,#13) do sl.Add(DivideAString(Value,#13,i));
Result:=setYcfgSection(YcfgFile,Section,sl,OverrideExisting);
sl.Free;
end;
function setYcfgSection(var YcfgFile:TStringList;Section,Value:string;OverrideExisting:boolean):boolean; overload;
var sl:TStringList;
i:Integer;
begin
sl:=TStringList.Create;
for i:=1 to getStringDivides(Value,#13) do sl.Add(DivideAString(Value,#13,i));
Result:=setYcfgSection(YcfgFile,Section,sl,OverrideExisting);
sl.Free;
end;
function setYcfgSection(YcfgFile,Section:string;Value:TStringList;OverrideExisting:Boolean):boolean; overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
Result:=setYcfgSection(sl,Section,Value,OverrideExisting);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
function setYcfgSection(var YcfgFile:TStringlist;Section:string;Value:TStringList;OverrideExisting:Boolean):boolean; overload;
var i:Integer;
begin
if OverrideExisting then
begin
delYcfgSection(YcfgFile,Section);
YcfgFile.Add(YcfgSectionInit+Section+YcfgSectionEnd);
for i:=0 to Value.Count-1 do YcfgFile.Add(Value.Strings[i]);
end else
begin
if not YcfgSectionExists(YcfgFile,Section) then
begin
YcfgFile.Add(YcfgSectionInit+Section+YcfgSectionEnd);
for i:=0 to Value.Count-1 do YcfgFile.Add(Value.Strings[i]);
end;
end;
end;
procedure setYcfgStr(YcfgFile,SearchString,DivideParam,Value:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
setYcfgStr(sl,Searchstring,DividePAram,Value);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure setYcfgStr(YcfgFile,SearchString,Value:string); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,Value);
end;
procedure setYcfgStr(var YcfgFile:Tstringlist;SearchString,DivideParam,Value:string); overload;
var i,j:Integer;
begin
j:=-1;
for i:=0 to YcfgFile.Count-1 do
if LowerCase(Copy(YcfgFile.Strings[i],1,Length(Searchstring+Divideparam)))=LowerCase(Searchstring+DivideParam) then j:=i;
if (YcfgFile.Count>=j) and (j>=0) then YcfgFile.Strings[i]:=Searchstring+DivideParam+Value else YcfgFile.Add(Searchstring+DivideParam+Value);
end;
procedure setYcfgStr(var YcfgFile:Tstringlist;SearchString,Value:string); overload;
begin
setYcfgStr(YcfgFile,Searchstring,YcfgDivideParam,Value);
end;
procedure setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,Value:string); overload;
var sl:TStringList;
begin
sl:=TStringList.Create;
if FileExists(YcfgFile) then sl.LoadFromFile(YcfgFile);
setYcfgSecStr(sl,Section,Searchstring,DivideParam,Value);
sl.SaveToFile(YcfgFile);
sl.Free;
end;
procedure setYcfgSecStr(YcfgFile,Section,SearchString,Value:string); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,Value);
end;
procedure setYcfgSecStr(var YcfgFile:Tstringlist;Section,SearchString,DivideParam,Value:string); overload;
var i:Integer;
point:TPoint;
check:Boolean;
begin
point:=getYcfgSectionPos(YcfgFile,Section);
check:=False;
for i:=0 to YcfgFile.Count-1 do
if LowerCase(Copy(YcfgFile.Strings[i],1,Length(Searchstring+Divideparam)))=LowerCase(Searchstring+DivideParam) then
if (i>=Point.X) and (i<=Point.Y) then
if (YcfgFile.Count>=i) and (i>=0) then
begin
YcfgFile.Strings[i]:=Searchstring+DivideParam+Value;
check:=true;
end;
if not check then YcfgFile.Insert(Point.Y,Searchstring+DivideParam+Value);
end;
procedure setYcfgSecStr(var YcfgFile:Tstringlist;Section,SearchString,Value:string); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,Value);
end;
procedure setYcfgInt(YcfgFile,SearchString,DivideParam:string;Value:integer); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,IntToStr(Value));
end;
procedure setYcfgInt(YcfgFile,SearchString:string;Value:integer); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,IntToStr(Value));
end;
procedure setYcfgInt(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:integer); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,IntToStr(Value));
end;
procedure setYcfgInt(var YcfgFile:Tstringlist;SearchString:string;Value:integer); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,IntToStr(Value));
end;
procedure setYcfgSecInt(YcfgFile,Section,SearchString,DivideParam:string;Value:integer); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,IntToStr(Value));
end;
procedure setYcfgSecInt(YcfgFile,Section,SearchString:string;Value:integer); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,IntToStr(Value));
end;
procedure setYcfgSecInt(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:integer); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,IntToStr(Value));
end;
procedure setYcfgSecInt(var YcfgFile:Tstringlist;Section,SearchString:string;Value:integer); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,IntToStr(Value));
end;
procedure setYcfgBool(YcfgFile,SearchString,DivideParam:string;Value:boolean); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,BoolToStr(Value));
end;
procedure setYcfgBool(YcfgFile,SearchString:string;Value:boolean); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,BoolToStr(Value));
end;
procedure setYcfgBool(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:boolean); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,BoolToStr(Value));
end;
procedure setYcfgBool(var YcfgFile:Tstringlist;SearchString:string;Value:boolean); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,BoolToStr(Value));
end;
procedure setYcfgSecBool(YcfgFile,Section,SearchString,DivideParam:string;Value:boolean); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,BoolToStr(Value));
end;
procedure setYcfgSecBool(YcfgFile,Section,SearchString:string;Value:boolean); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,BoolToStr(Value));
end;
procedure setYcfgSecBool(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:boolean); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,BoolToStr(Value));
end;
procedure setYcfgSecBool(var YcfgFile:Tstringlist;Section,SearchString:string;Value:boolean); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,BoolToStr(Value));
end;
procedure setYcfgStrEnCrypted(YcfgFile,SearchString,DivideParam,Key,Value:string); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,EnCryptStr(Key,Value));
end;
procedure setYcfgStrEnCrypted(YcfgFile,SearchString,Key,Value:string); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,EnCryptStr(Key,Value));
end;
procedure setYcfgStrEnCrypted(var YcfgFile:Tstringlist;SearchString,DivideParam,Key,Value:string); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,EnCryptStr(Key,Value));
end;
procedure setYcfgStrEnCrypted(var YcfgFile:Tstringlist;SearchString,Key,Value:string); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,EnCryptStr(Key,Value));
end;
procedure setYcfgSecStrEnCrypted(YcfgFile,Section,SearchString,DivideParam,Key,Value:string); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,Divideparam,EnCryptStr(Key,Value));
end;
procedure setYcfgSecStrEnCrypted(YcfgFile,Section,SearchString,Key,Value:string); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideparam,EnCryptStr(Key,Value));
end;
procedure setYcfgSecStrEnCrypted(var YcfgFile:Tstringlist;Section,SearchString,DivideParam,Key,Value:string); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,Divideparam,EnCryptStr(Key,Value));
end;
procedure setYcfgSecStrEnCrypted(var YcfgFile:Tstringlist;Section,SearchString,Key,Value:string); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideparam,EnCryptStr(Key,Value));
end;
procedure setYcfgFont(YcfgFile,SearchString,DivideParam:string;Value:TFont); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgFont(YcfgFile,SearchString:string;Value:TFont); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgFont(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:TFont); overload;
begin
setYcfgStr(YcfgFile,SearchString,DivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgFont(var YcfgFile:Tstringlist;SearchString:string;Value:TFont); overload;
begin
setYcfgStr(YcfgFile,SearchString,YcfgDivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgSecFont(YcfgFile,Section,SearchString,DivideParam:string;Value:TFont); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgSecFont(YcfgFile,Section,SearchString:string;Value:TFont); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgSecFont(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:TFont); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
procedure setYcfgSecFont(var YcfgFile:Tstringlist;Section,SearchString:string;Value:TFont); overload;
begin
setYcfgSecStr(YcfgFile,Section,SearchString,YcfgDivideParam,IntToStr(Value.Charset)+StringDivideParam+IntToStr(Value.Color)+StringDivideParam+Value.Name+StringDivideParam+IntToStr(Value.Size)+StringDivideParam+IntToStr(Integer(Value.Pitch))+StringDivideParam);
end;
end.