+stringWithCRs
authorClaus Gittinger <cg@exept.de>
Fri, 21 Mar 2003 11:59:01 +0100
changeset 3823 e76715148cb3
parent 3822 decfe19a2bb2
child 3824 723af95c5781
+stringWithCRs (replaces CRs BEFORE expanding args, to avoid DOS fileName clobbering)
ResourcePack.st
--- a/ResourcePack.st	Fri Mar 21 00:42:22 2003 +0100
+++ b/ResourcePack.st	Fri Mar 21 11:59:01 2003 +0100
@@ -486,6 +486,69 @@
 
     template := self at:s ifAbsent:s.
     ^ template expandPlaceholdersWith:argArray
+!
+
+stringWithCRs:s with:arg
+    "translate, replace \'s with CRs and finally expand arg.
+     CR-replacement is donw before args are inserted 
+     i.e. if any arg contains a backslash (DOS filenames), those are not translated."
+
+    ^ self stringWithCRs:s withArgs:(Array with:arg)
+
+    "Modified: / 21.3.2003 / 14:22:09 / cg"
+!
+
+stringWithCRs:s with:arg1 with:arg2
+    "translate, replace \'s with CRs and finally expand args.
+     CR-replacement is donw before args are inserted 
+     i.e. if any arg contains a backslash (DOS filenames), those are not translated."
+
+    ^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2)
+
+    "Modified: / 21.3.2003 / 14:22:06 / cg"
+!
+
+stringWithCRs:s with:arg1 with:arg2 with:arg3
+    "translate, replace \'s with CRs and finally expand args.
+     CR-replacement is donw before args are inserted 
+     i.e. if any arg contains a backslash (DOS filenames), those are not translated."
+
+    ^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3)
+
+    "Created: 9.12.1995 / 19:08:50 / cg"
+!
+
+stringWithCRs:s with:arg1 with:arg2 with:arg3 with:arg4
+    "translate, replace \'s with CRs and finally expand args.
+     CR-replacement is donw before args are inserted 
+     i.e. if any arg contains a backslash (DOS filenames), those are not translated."
+
+    ^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4)
+
+    "Modified: / 21.3.2003 / 14:21:48 / cg"
+!
+
+stringWithCRs:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5
+    "translate, replace \'s with CRs and finally expand args.
+     CR-replacement is donw before args are inserted 
+     i.e. if any arg contains a backslash (DOS filenames), those are not translated."
+
+    ^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5)
+
+    "Modified: / 21.3.2003 / 14:21:55 / cg"
+!
+
+stringWithCRs:s withArgs:argArray
+    "translate, replace \'s with CRs and finally expand args.
+     CR-replacement is donw before args are inserted 
+     i.e. if any arg contains a backslash (DOS filenames), those are not translated."
+
+    |template|
+
+    template := self at:s ifAbsent:s.
+    ^ template withCRs expandPlaceholdersWith:argArray
+
+    "Modified: / 21.3.2003 / 14:21:59 / cg"
 ! !
 
 !ResourcePack methodsFor:'accessing-internals'!
@@ -813,7 +876,7 @@
 !ResourcePack class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.77 2003-03-02 20:52:37 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.78 2003-03-21 10:59:01 cg Exp $'
 ! !
 
 ResourcePack initialize!