From 24261adb0ff5b4ee1a1250930b1dc6032f3fb47b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 23 May 2018 09:17:13 +0200 Subject: escape-Funktionen nach units/lowlevelunit.pas ausgelagert --- Make.lps | 103 +++++++++++++++++++++++++-------------------------- dateibeziehungen.pas | 2 +- tools.pas | 38 ------------------- 3 files changed, 51 insertions(+), 92 deletions(-) diff --git a/Make.lps b/Make.lps index 658fae9..55cb9cc 100644 --- a/Make.lps +++ b/Make.lps @@ -22,8 +22,8 @@ - - + + @@ -42,9 +42,9 @@ - - - + + + @@ -63,8 +63,8 @@ - - + + @@ -149,122 +149,119 @@ - + - + - + - + - - - + + - + - - + + - - + + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - + + - - + - - + + - - + + - - + - - + + - - + + - - + + - - + + - + - diff --git a/dateibeziehungen.pas b/dateibeziehungen.pas index ebcc892..7bd4560 100644 --- a/dateibeziehungen.pas +++ b/dateibeziehungen.pas @@ -493,7 +493,7 @@ begin if pos('{',zielFkt)=0 then begin if not quellErsetzung(zielFkt,rtKein,quellen,quellen.count) then exit; if pos('*',zielFkt)=0 then begin - zielFkt:=unescape(zielFkt); + zielFkt:=unEscapeCommas(zielFkt); ziele.add(_dats.finde(zielFkt,result)); end else begin diff --git a/tools.pas b/tools.pas index 032e3a7..599fc1c 100644 --- a/tools.pas +++ b/tools.pas @@ -9,7 +9,6 @@ uses type tAktualitaet = (aNichtVorhanden,aVeraltet,aAktuell,aWirdErneuert); - tRegexTyp = (rtKein,rtFpc,rtShell); tMyStringListBArray = array[boolean] of tMyStringList; tSummenDatei = record name: string; @@ -66,9 +65,6 @@ function notQuotedPos(was,worin: string): longint; function unEscapedPos(was,worin: string): longint; procedure testeObBefehlLokal(bef, ordner: string; dateiListe: tMyStringList; lokTest: tRegExpr); function extrahiereAlleDateien(woraus: string; dateiListe: tMyStringList): tMyStringList; -function unescape(s: string): string; -function escape(s,toe,es: string): string; -function escapeStringToRegex(s: string; typ: tRegexTyp; extras: string = ''): string; inline; procedure ersetzeAlleVorkommen(var worin: string; was,wodurch: string); function unterVerzeichnisRegex(dateien: array of const): string; function vergleicheNamenVonDateienMitDaten(item1,item2: pointer): integer; @@ -592,40 +588,6 @@ begin end; end; -function unescape(s: string): string; -begin - result:=s; - while pos('\,',result)>0 do - delete(result,pos('\,',result),1); -end; - -function escape(s,toe,es: string): string; -var - i,j: longint; - b: boolean; -begin - result:=''; - for i:=1 to length(s) do begin - b:=false; - for j:=1 to length(toe) do - b:=b or (toe[j]=s[i]); - if b then result:=result+es; - result:=result+s[i]; - end; -end; - -function escapeStringToRegex(s: string; typ: tRegexTyp; extras: string = ''): string; -begin - case typ of - rtKein: - result:=s; - rtFpc: - result:=escape(s,'\.[+^$'+extras,'\'); - rtShell: - result:=escape(s,'\.[^$'+extras,'\'); - end{of case}; -end; - procedure ersetzeAlleVorkommen(var worin: string; was,wodurch: string); begin while pos(was,worin)>0 do begin -- cgit v1.2.3-54-g00ecf