class: CharacterArray
authorClaus Gittinger <cg@exept.de>
Sun, 24 Jan 2016 00:57:39 +0100
changeset 3715 59267baeb546
parent 3714 ef2c04ec8047
child 3718 21297ecb0261
child 3719 3750518f5ada
class: CharacterArray changed: #printf:on: added c-style escapes
extensions.st
--- a/extensions.st	Sat Jan 23 04:57:13 2016 +0000
+++ b/extensions.st	Sun Jan 24 00:57:39 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "{ Package: 'stx:libbasic2' }"!
 
 !CharacterArray methodsFor:'matching - phonetic'!
@@ -20,26 +18,26 @@
 
     "
      #(
-	'Müller'
+	'Müller'
 	'Miller'
 	'Mueller'
-	'Mühler'
-	'Mühlherr'
-	'Mülherr'
+	'Mühler'
+	'Mühlherr'
+	'Mülherr'
 	'Myler'
 	'Millar'
 	'Myller'
-	'Müllar'
-	'Müler'
+	'Müllar'
+	'Müler'
 	'Muehler'
-	'Mülller'
-	'Müllerr'
+	'Mülller'
+	'Müllerr'
 	'Muehlherr'
 	'Muellar'
 	'Mueler'
-	'Mülleer'
+	'Mülleer'
 	'Mueller'
-	'Nüller'
+	'Nüller'
 	'Nyller'
 	'Niler'
 	'Czerny'
@@ -65,7 +63,7 @@
      'Braeschneff' asKoelnerPhoneticCode -> '17863'
      'Braessneff' asKoelnerPhoneticCode -> '17863'
      'Pressneff' asKoelnerPhoneticCode -> '17863'
-     'Presznäph' asKoelnerPhoneticCode -> '17863'
+     'Presznäph' asKoelnerPhoneticCode -> '17863'
     "
 ! !
 
@@ -157,19 +155,26 @@
 
      For copyright information, see goodies/String-printf_scanf.chg"
 
-    |argStream inStream char|
+    |argStream inStream char escChar|
 
     argStream := ReadStream on:args.
     inStream := ReadStream on:self.
     [ inStream atEnd ] whileFalse:[
-	(char := inStream next) == $% ifFalse:[
-	    outStream nextPut:char
-	] ifTrue:[
-	    self
-		printf_printArgFrom:inStream
-		to:outStream
-		withData:argStream
-	]
+        (char := inStream next) == $% ifFalse:[
+            char == $\ ifTrue:[
+                escChar := inStream next.
+                escChar == $n ifTrue:[ char := Character nl ]
+                ifFalse:[ escChar == $t ifTrue:[ char := Character tab ]
+                ifFalse:[ escChar == $r ifTrue:[ char := Character return ]
+                ifFalse:[ char := escChar ]]]
+            ].        
+            outStream nextPut:char
+        ] ifTrue:[
+            self
+                printf_printArgFrom:inStream
+                to:outStream
+                withData:argStream
+        ]
     ]
 ! !
 
@@ -1278,6 +1283,6 @@
 !stx_libbasic2 class methodsFor:'documentation'!
 
 extensionsVersion_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/extensions.st,v 1.31 2015-06-05 16:13:05 stefan Exp $'
+    ^ '$Header$'
 ! !