The Trunk: Multilingual-ul.134.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Multilingual-ul.134.mcz

commits-2
Levente Uzonyi uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-ul.134.mcz

==================== Summary ====================

Name: Multilingual-ul.134
Author: ul
Time: 31 January 2011, 2:11:28.724 am
UUID: 6ed3b9ef-ef78-f44e-bc6c-850656c00040
Ancestors: Multilingual-ul.133

A fix for http://bugs.squeak.org/view.php?id=7603 . Requires Collections-ul.422.

Added TextConverter >> #next:putAll:startingAt:toStream: which is used by MultiByteFileStream and MultiByteBinaryOrTextStream to properly implement #next:putAll:startingAt:.

=============== Diff against Multilingual-ul.133 ===============

Item was added:
+ ----- Method: MultiByteBinaryOrTextStream>>basicNext:putAll:startingAt: (in category 'private basic') -----
+ basicNext: anInteger putAll: aCollection startingAt: startIndex
+
+ ^super next: anInteger putAll: aCollection startingAt: startIndex!

Item was added:
+ ----- Method: MultiByteBinaryOrTextStream>>next:putAll:startingAt: (in category 'public') -----
+ next: anInteger putAll: aCollection startingAt: startIndex
+
+ (self isBinary or: [ aCollection class == ByteArray ]) ifTrue: [
+ ^super next: anInteger putAll: aCollection startingAt: startIndex ].
+ ^self converter next: anInteger putAll: aCollection startingAt: startIndex toStream: self
+ !

Item was added:
+ ----- Method: MultiByteFileStream>>basicNext:putAll:startingAt: (in category 'private basic') -----
+ basicNext: anInteger putAll: aCollection startingAt: startIndex
+
+ ^super next: anInteger putAll: aCollection startingAt: startIndex!

Item was added:
+ ----- Method: MultiByteFileStream>>next:putAll:startingAt: (in category 'public') -----
+ next: anInteger putAll: aCollection startingAt: startIndex
+
+ (self isBinary or: [ aCollection class == ByteArray ]) ifTrue: [
+ ^super next: anInteger putAll: aCollection startingAt: startIndex ].
+ ^converter next: anInteger putAll: aCollection startingAt: startIndex toStream: self!

Item was changed:
  ----- Method: MultiByteFileStream>>nextPutAll: (in category 'public') -----
  nextPutAll: aCollection
 
  (self isBinary or: [aCollection class == ByteArray]) ifTrue: [
  ^ super nextPutAll: aCollection.
  ].
+ ^converter nextPutAll: aCollection toStream: self!
- converter nextPutAll: aCollection toStream: self.
- ^aCollection!

Item was added:
+ ----- Method: TextConverter>>next:putAll:startingAt:toStream: (in category 'conversion') -----
+ next: anInteger putAll: aString startingAt: startIndex toStream: aStream
+ "Handle fast conversion if ByteString"
+
+ | lastIndex nextIndex |
+ aString class == ByteString ifFalse: [
+ startIndex to: startIndex + anInteger - 1 do: [ :index |
+ self nextPut: (aString at: index) toStream: aStream ].
+ ^aString ].
+ aStream isBinary ifTrue: [
+ aStream basicNext: anInteger putAll: aString startingAt: startIndex.
+ ^aString ].
+ lastIndex := startIndex.
+ [ (nextIndex := ByteString
+ findFirstInString: aString
+ inSet: latin1Map
+ startingAt: lastIndex) = 0 or: [ nextIndex > anInteger ] ] whileFalse: [
+ aStream
+ basicNext: nextIndex - lastIndex putAll: aString startingAt: lastIndex;
+ basicNextPutAll: (latin1Encodings at: (aString byteAt: nextIndex) + 1).
+ lastIndex := nextIndex + 1 ].
+ aStream basicNext: anInteger - lastIndex + 1 putAll: aString startingAt: lastIndex.
+ ^aString!

Item was changed:
  ----- Method: TextConverter>>nextPutAll:toStream: (in category 'conversion') -----
  nextPutAll: aString toStream: aStream
  "Handle fast conversion if ByteString"
 
+ ^self next: aString size putAll: aString startingAt: 1 toStream: aStream!
- | lastIndex nextIndex |
- aString class == ByteString ifFalse: [
- aString do: [:char | self nextPut: char toStream: aStream].
- ^self].
-
- aStream isBinary ifTrue: [
- aStream basicNextPutAll: aString.
- ^self].
- lastIndex := 1.
- [nextIndex := ByteString findFirstInString: aString inSet: latin1Map startingAt: lastIndex.
- nextIndex = 0] whileFalse:
- [aStream next: nextIndex-lastIndex putAll: aString startingAt: lastIndex.
- aStream basicNextPutAll: (latin1Encodings at: (aString byteAt: nextIndex)+1).
- lastIndex := nextIndex + 1].
- aStream next: aString size-lastIndex+1 putAll: aString startingAt: lastIndex.
- ^self
- !