Nicolas Cellier uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-nice.67.mcz
==================== Summary ====================
Name: Network-nice.67
Author: nice
Time: 28 March 2010, 10:36:49.996 pm
UUID: 64b9fd8e-4cf4-4f47-bce6-d70517a4842c
Ancestors: Network-bp.66
1) fix some _ assignment
2) add Socket support for #next:putAll:startingAt: and #readInto:startingAt:count:
3) do not let ascii/binary resetBuffers gratuitously
=============== Diff against Network-bp.66 ===============
Item was changed:
----- Method: SocketStream>>ascii (in category 'configuration') -----
ascii
"Tell the SocketStream to send data
as Strings instead of ByteArrays.
This is default."
binary := false.
+ inBuffer
+ ifNil: [self resetBuffers]
+ ifNotNil:
+ [inBuffer := inBuffer asString.
+ outBuffer := outBuffer asString]!
- self resetBuffers!
Item was changed:
----- Method: SocketStream>>binary (in category 'configuration') -----
binary
"Tell the SocketStream to send data
as ByteArrays instead of Strings.
Default is ascii."
binary := true.
+ inBuffer
+ ifNil: [self resetBuffers]
+ ifNotNil:
+ [inBuffer := inBuffer asByteArray.
+ outBuffer := outBuffer asByteArray]!
- self resetBuffers!
Item was added:
+ ----- Method: SocketStream>>next:putAll:startingAt: (in category 'stream out') -----
+ next: n putAll: aCollection startingAt: startIndex
+ "Put a String or a ByteArray onto the stream.
+ Currently a large collection will allocate a large buffer.
+ Warning: this does not work with WideString: they have to be converted first."
+
+ self adjustOutBuffer: n.
+ outBuffer replaceFrom: outNextToWrite to: outNextToWrite + n - 1 with: aCollection startingAt: startIndex.
+ outNextToWrite := outNextToWrite + n.
+ self checkFlush.
+ ^aCollection!
Item was added:
+ ----- Method: SocketStream>>readInto:startingAt:count: (in category 'stream in') -----
+ readInto: aCollection startingAt: startIndex count: anInteger
+ "Read n objects into the given collection starting at startIndex.
+ Return number of elements that have been read."
+
+ "Implementation note: This method DOES signal timeout if not
+ enough elements are received. It does NOT signal
+ ConnectionClosed as closing the connection is the only way by
+ which partial data can be read."
+
+ | start amount |
+
+ [self receiveData: anInteger] on: ConnectionClosed do:[:ex| ex return].
+
+ "Inlined version of nextInBuffer: to avoid copying the contents"
+ amount := anInteger min: (inNextToWrite - lastRead - 1).
+ start := lastRead + 1.
+ lastRead := lastRead + amount.
+ aCollection
+ replaceFrom: startIndex
+ to: startIndex + amount-1
+ with: inBuffer
+ startingAt: start.
+ ^amount!
Item was changed:
----- Method: ServerDirectory>>oldFileOrNoneNamed: (in category 'file directory') -----
oldFileOrNoneNamed: fullName
"If the file exists, answer a read-only RemoteFileStream on it. If it doesn't, answer nil. fullName is directory path, and does include name of the server. Or just a simple fileName. Do prefetch the data."
^ Cursor wait showWhile:
+ [ | file |
+ file := self asServerFileNamed: fullName.
- [ | file |file := self asServerFileNamed: fullName.
file readOnly.
"file exists ifFalse: [^ nil]." "on the server"
file isTypeFile
ifTrue: [FileStream oldFileOrNoneNamed: (file fileNameRelativeTo: self)]
ifFalse: [self streamOnBeginningOf: file]]!
Item was changed:
----- Method: MailAddressTokenizer class>>initialize (in category 'class initialization') -----
initialize
"Initalize class variables using MailAddressTokenizer initialize"
| atomChars |
+ CSParens := CharacterSet empty.
- CSParens _ CharacterSet empty.
CSParens addAll: '()'.
+ CSSpecials := CharacterSet empty.
- CSSpecials _ CharacterSet empty.
CSSpecials addAll: '()<>@,;:\".[]'.
+ CSNonSeparators := CharacterSet separators complement.
- CSNonSeparators _ CharacterSet separators complement.
"(from RFC 2822)"
atomChars := CharacterSet empty.
atomChars addAll: ($A to: $Z).
atomChars addAll: ($a to: $z).
atomChars addAll: ($0 to: $9).
atomChars addAll: '!!#$%^''*+-/=?^_`{|}~'.
CSNonAtom := atomChars complement.!
Nicolas Cellier uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-nice.67.mcz
==================== Summary ====================
Name: Network-nice.67
Author: nice
Time: 28 March 2010, 10:36:49.996 pm
UUID: 64b9fd8e-4cf4-4f47-bce6-d70517a4842c
Ancestors: Network-bp.66
1) fix some _ assignment
2) add Socket support for #next:putAll:startingAt: and #readInto:startingAt:count:
3) do not let ascii/binary resetBuffers gratuitously
=============== Diff against Network-bp.66 ===============
Item was changed:
----- Method: SocketStream>>ascii (in category 'configuration') -----
ascii
"Tell the SocketStream to send data
as Strings instead of ByteArrays.
This is default."
binary := false.
+ inBuffer
+ ifNil: [self resetBuffers]
+ ifNotNil:
+ [inBuffer := inBuffer asString.
+ outBuffer := outBuffer asString]!
- self resetBuffers!
Item was changed:
----- Method: SocketStream>>binary (in category 'configuration') -----
binary
"Tell the SocketStream to send data
as ByteArrays instead of Strings.
Default is ascii."
binary := true.
+ inBuffer
+ ifNil: [self resetBuffers]
+ ifNotNil:
+ [inBuffer := inBuffer asByteArray.
+ outBuffer := outBuffer asByteArray]!
- self resetBuffers!
Item was added:
+ ----- Method: SocketStream>>next:putAll:startingAt: (in category 'stream out') -----
+ next: n putAll: aCollection startingAt: startIndex
+ "Put a String or a ByteArray onto the stream.
+ Currently a large collection will allocate a large buffer.
+ Warning: this does not work with WideString: they have to be converted first."
+
+ self adjustOutBuffer: n.
+ outBuffer replaceFrom: outNextToWrite to: outNextToWrite + n - 1 with: aCollection startingAt: startIndex.
+ outNextToWrite := outNextToWrite + n.
+ self checkFlush.
+ ^aCollection!
Item was added:
+ ----- Method: SocketStream>>readInto:startingAt:count: (in category 'stream in') -----
+ readInto: aCollection startingAt: startIndex count: anInteger
+ "Read n objects into the given collection starting at startIndex.
+ Return number of elements that have been read."
+
+ "Implementation note: This method DOES signal timeout if not
+ enough elements are received. It does NOT signal
+ ConnectionClosed as closing the connection is the only way by
+ which partial data can be read."
+
+ | start amount |
+
+ [self receiveData: anInteger] on: ConnectionClosed do:[:ex| ex return].
+
+ "Inlined version of nextInBuffer: to avoid copying the contents"
+ amount := anInteger min: (inNextToWrite - lastRead - 1).
+ start := lastRead + 1.
+ lastRead := lastRead + amount.
+ aCollection
+ replaceFrom: startIndex
+ to: startIndex + amount-1
+ with: inBuffer
+ startingAt: start.
+ ^amount!
Item was changed:
----- Method: ServerDirectory>>oldFileOrNoneNamed: (in category 'file directory') -----
oldFileOrNoneNamed: fullName
"If the file exists, answer a read-only RemoteFileStream on it. If it doesn't, answer nil. fullName is directory path, and does include name of the server. Or just a simple fileName. Do prefetch the data."
^ Cursor wait showWhile:
+ [ | file |
+ file := self asServerFileNamed: fullName.
- [ | file |file := self asServerFileNamed: fullName.
file readOnly.
"file exists ifFalse: [^ nil]." "on the server"
file isTypeFile
ifTrue: [FileStream oldFileOrNoneNamed: (file fileNameRelativeTo: self)]
ifFalse: [self streamOnBeginningOf: file]]!
Item was changed:
----- Method: MailAddressTokenizer class>>initialize (in category 'class initialization') -----
initialize
"Initalize class variables using MailAddressTokenizer initialize"
| atomChars |
+ CSParens := CharacterSet empty.
- CSParens _ CharacterSet empty.
CSParens addAll: '()'.
+ CSSpecials := CharacterSet empty.
- CSSpecials _ CharacterSet empty.
CSSpecials addAll: '()<>@,;:\".[]'.
+ CSNonSeparators := CharacterSet separators complement.
- CSNonSeparators _ CharacterSet separators complement.
"(from RFC 2822)"
atomChars := CharacterSet empty.
atomChars addAll: ($A to: $Z).
atomChars addAll: ($a to: $z).
atomChars addAll: ($0 to: $9).
atomChars addAll: '!!#$%^''*+-/=?^_`{|}~'.
CSNonAtom := atomChars complement.!
Nicolas Cellier uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-nice.67.mcz
==================== Summary ====================
Name: Network-nice.67
Author: nice
Time: 28 March 2010, 10:36:49.996 pm
UUID: 64b9fd8e-4cf4-4f47-bce6-d70517a4842c
Ancestors: Network-bp.66
1) fix some _ assignment
2) add Socket support for #next:putAll:startingAt: and #readInto:startingAt:count:
3) do not let ascii/binary resetBuffers gratuitously
=============== Diff against Network-bp.66 ===============
Item was changed:
----- Method: SocketStream>>ascii (in category 'configuration') -----
ascii
"Tell the SocketStream to send data
as Strings instead of ByteArrays.
This is default."
binary := false.
+ inBuffer
+ ifNil: [self resetBuffers]
+ ifNotNil:
+ [inBuffer := inBuffer asString.
+ outBuffer := outBuffer asString]!
- self resetBuffers!
Item was changed:
----- Method: SocketStream>>binary (in category 'configuration') -----
binary
"Tell the SocketStream to send data
as ByteArrays instead of Strings.
Default is ascii."
binary := true.
+ inBuffer
+ ifNil: [self resetBuffers]
+ ifNotNil:
+ [inBuffer := inBuffer asByteArray.
+ outBuffer := outBuffer asByteArray]!
- self resetBuffers!
Item was added:
+ ----- Method: SocketStream>>next:putAll:startingAt: (in category 'stream out') -----
+ next: n putAll: aCollection startingAt: startIndex
+ "Put a String or a ByteArray onto the stream.
+ Currently a large collection will allocate a large buffer.
+ Warning: this does not work with WideString: they have to be converted first."
+
+ self adjustOutBuffer: n.
+ outBuffer replaceFrom: outNextToWrite to: outNextToWrite + n - 1 with: aCollection startingAt: startIndex.
+ outNextToWrite := outNextToWrite + n.
+ self checkFlush.
+ ^aCollection!
Item was added:
+ ----- Method: SocketStream>>readInto:startingAt:count: (in category 'stream in') -----
+ readInto: aCollection startingAt: startIndex count: anInteger
+ "Read n objects into the given collection starting at startIndex.
+ Return number of elements that have been read."
+
+ "Implementation note: This method DOES signal timeout if not
+ enough elements are received. It does NOT signal
+ ConnectionClosed as closing the connection is the only way by
+ which partial data can be read."
+
+ | start amount |
+
+ [self receiveData: anInteger] on: ConnectionClosed do:[:ex| ex return].
+
+ "Inlined version of nextInBuffer: to avoid copying the contents"
+ amount := anInteger min: (inNextToWrite - lastRead - 1).
+ start := lastRead + 1.
+ lastRead := lastRead + amount.
+ aCollection
+ replaceFrom: startIndex
+ to: startIndex + amount-1
+ with: inBuffer
+ startingAt: start.
+ ^amount!
Item was changed:
----- Method: ServerDirectory>>oldFileOrNoneNamed: (in category 'file directory') -----
oldFileOrNoneNamed: fullName
"If the file exists, answer a read-only RemoteFileStream on it. If it doesn't, answer nil. fullName is directory path, and does include name of the server. Or just a simple fileName. Do prefetch the data."
^ Cursor wait showWhile:
+ [ | file |
+ file := self asServerFileNamed: fullName.
- [ | file |file := self asServerFileNamed: fullName.
file readOnly.
"file exists ifFalse: [^ nil]." "on the server"
file isTypeFile
ifTrue: [FileStream oldFileOrNoneNamed: (file fileNameRelativeTo: self)]
ifFalse: [self streamOnBeginningOf: file]]!
Item was changed:
----- Method: MailAddressTokenizer class>>initialize (in category 'class initialization') -----
initialize
"Initalize class variables using MailAddressTokenizer initialize"
| atomChars |
+ CSParens := CharacterSet empty.
- CSParens _ CharacterSet empty.
CSParens addAll: '()'.
+ CSSpecials := CharacterSet empty.
- CSSpecials _ CharacterSet empty.
CSSpecials addAll: '()<>@,;:\".[]'.
+ CSNonSeparators := CharacterSet separators complement.
- CSNonSeparators _ CharacterSet separators complement.
"(from RFC 2822)"
atomChars := CharacterSet empty.
atomChars addAll: ($A to: $Z).
atomChars addAll: ($a to: $z).
atomChars addAll: ($0 to: $9).
atomChars addAll: '!!#$%^''*+-/=?^_`{|}~'.
CSNonAtom := atomChars complement.!
Nicolas Cellier uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-nice.15.mcz
==================== Summary ====================
Name: TrueType-nice.15
Author: nice
Time: 28 March 2010, 7:10:44.962 pm
UUID: 6a8e5e5b-bcf5-4e58-8edf-6f5fa1f9f3c5
Ancestors: TrueType-nice.14
Authorize parsing of TTCF file version 2.
That certainly is not sufficient, but at least, that allows (TTFileDescription installFamilyNamed: 'Arial') to work on Mac Snow Leopard.
=============== Diff against TrueType-nice.14 ===============
Item was changed:
----- Method: TTFileDescription class>>allFamilyNamesAndFiles (in category 'font paths') -----
allFamilyNamesAndFiles
"Answer a dictionary of all known family names and their corresponding file names."
AllFontsAndFiles ifNil:[
AllFontsAndFiles := Dictionary new.
+ Cursor wait showWhile:[self allFontsDo:[:font|
+ | names |
- Cursor wait showWhile:[self allFontsDo:[:font| | names |
names := AllFontsAndFiles at: font familyName
ifAbsentPut:[OrderedCollection new].
names add: font fileName]]].
^AllFontsAndFiles !
Item was changed:
----- Method: TTFileDescription class>>allFontsAndFiles (in category 'font paths') -----
allFontsAndFiles
"Answer a dictionary of all known family names and their corresponding file names."
AllFontsAndFiles ifNil:[
AllFontsAndFiles := Dictionary new.
+ Cursor wait showWhile:[self allFontsDo:[:font|
+ | names |
- Cursor wait showWhile:[self allFontsDo:[:font| | names |
names := AllFontsAndFiles at: font familyName
ifAbsentPut:[OrderedCollection new].
names add: font fileName]]].
^AllFontsAndFiles !
Item was changed:
----- Method: TTFileDescription class>>fontOffsetsInFile: (in category 'instance creation') -----
fontOffsetsInFile: file
"Answer a collection of font offsets in the given file"
| tag version nFonts |
file position: 0.
tag := file next: 4.
+ tag caseOf: {
- tag caseOf:{
['true' asByteArray] -> ["Version 1.0 TTF file"
"http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html
The values 'true' (0x74727565) and 0x00010000 are recognized by the Mac OS
as referring to TrueType fonts."
^Array with: 0 "only one font"
].
[#[0 1 0 0]] -> ["Version 1.0 TTF file"
^Array with: 0 "only one font"
].
['ttcf' asByteArray] -> ["TTC file"
version := file next: 4.
+ (version = #[0 1 0 0] or: [version = #[0 2 0 0]]) ifFalse: [^self error: 'Unsupported TTC version'].
- version = #(0 1 0 0) asByteArray ifFalse:[^self error: 'Unsupported TTC version'].
nFonts := file nextNumber: 4.
+ ^(1 to: nFonts) collect: [:i | file nextNumber: 4].
- ^(1 to: nFonts) collect:[:i| file nextNumber: 4].
].
} otherwise:[
self error: 'This is not a valid Truetype file'.
].!
Nicolas Cellier uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-nice.15.mcz
==================== Summary ====================
Name: TrueType-nice.15
Author: nice
Time: 28 March 2010, 7:10:44.962 pm
UUID: 6a8e5e5b-bcf5-4e58-8edf-6f5fa1f9f3c5
Ancestors: TrueType-nice.14
Authorize parsing of TTCF file version 2.
That certainly is not sufficient, but at least, that allows (TTFileDescription installFamilyNamed: 'Arial') to work on Mac Snow Leopard.
=============== Diff against TrueType-nice.14 ===============
Item was changed:
----- Method: TTFileDescription class>>allFamilyNamesAndFiles (in category 'font paths') -----
allFamilyNamesAndFiles
"Answer a dictionary of all known family names and their corresponding file names."
AllFontsAndFiles ifNil:[
AllFontsAndFiles := Dictionary new.
+ Cursor wait showWhile:[self allFontsDo:[:font|
+ | names |
- Cursor wait showWhile:[self allFontsDo:[:font| | names |
names := AllFontsAndFiles at: font familyName
ifAbsentPut:[OrderedCollection new].
names add: font fileName]]].
^AllFontsAndFiles !
Item was changed:
----- Method: TTFileDescription class>>allFontsAndFiles (in category 'font paths') -----
allFontsAndFiles
"Answer a dictionary of all known family names and their corresponding file names."
AllFontsAndFiles ifNil:[
AllFontsAndFiles := Dictionary new.
+ Cursor wait showWhile:[self allFontsDo:[:font|
+ | names |
- Cursor wait showWhile:[self allFontsDo:[:font| | names |
names := AllFontsAndFiles at: font familyName
ifAbsentPut:[OrderedCollection new].
names add: font fileName]]].
^AllFontsAndFiles !
Item was changed:
----- Method: TTFileDescription class>>fontOffsetsInFile: (in category 'instance creation') -----
fontOffsetsInFile: file
"Answer a collection of font offsets in the given file"
| tag version nFonts |
file position: 0.
tag := file next: 4.
+ tag caseOf: {
- tag caseOf:{
['true' asByteArray] -> ["Version 1.0 TTF file"
"http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html
The values 'true' (0x74727565) and 0x00010000 are recognized by the Mac OS
as referring to TrueType fonts."
^Array with: 0 "only one font"
].
[#[0 1 0 0]] -> ["Version 1.0 TTF file"
^Array with: 0 "only one font"
].
['ttcf' asByteArray] -> ["TTC file"
version := file next: 4.
+ (version = #[0 1 0 0] or: [version = #[0 2 0 0]]) ifFalse: [^self error: 'Unsupported TTC version'].
- version = #(0 1 0 0) asByteArray ifFalse:[^self error: 'Unsupported TTC version'].
nFonts := file nextNumber: 4.
+ ^(1 to: nFonts) collect: [:i | file nextNumber: 4].
- ^(1 to: nFonts) collect:[:i| file nextNumber: 4].
].
} otherwise:[
self error: 'This is not a valid Truetype file'.
].!
Nicolas Cellier uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-nice.15.mcz
==================== Summary ====================
Name: TrueType-nice.15
Author: nice
Time: 28 March 2010, 7:10:44.962 pm
UUID: 6a8e5e5b-bcf5-4e58-8edf-6f5fa1f9f3c5
Ancestors: TrueType-nice.14
Authorize parsing of TTCF file version 2.
That certainly is not sufficient, but at least, that allows (TTFileDescription installFamilyNamed: 'Arial') to work on Mac Snow Leopard.
=============== Diff against TrueType-nice.14 ===============
Item was changed:
----- Method: TTFileDescription class>>allFamilyNamesAndFiles (in category 'font paths') -----
allFamilyNamesAndFiles
"Answer a dictionary of all known family names and their corresponding file names."
AllFontsAndFiles ifNil:[
AllFontsAndFiles := Dictionary new.
+ Cursor wait showWhile:[self allFontsDo:[:font|
+ | names |
- Cursor wait showWhile:[self allFontsDo:[:font| | names |
names := AllFontsAndFiles at: font familyName
ifAbsentPut:[OrderedCollection new].
names add: font fileName]]].
^AllFontsAndFiles !
Item was changed:
----- Method: TTFileDescription class>>allFontsAndFiles (in category 'font paths') -----
allFontsAndFiles
"Answer a dictionary of all known family names and their corresponding file names."
AllFontsAndFiles ifNil:[
AllFontsAndFiles := Dictionary new.
+ Cursor wait showWhile:[self allFontsDo:[:font|
+ | names |
- Cursor wait showWhile:[self allFontsDo:[:font| | names |
names := AllFontsAndFiles at: font familyName
ifAbsentPut:[OrderedCollection new].
names add: font fileName]]].
^AllFontsAndFiles !
Item was changed:
----- Method: TTFileDescription class>>fontOffsetsInFile: (in category 'instance creation') -----
fontOffsetsInFile: file
"Answer a collection of font offsets in the given file"
| tag version nFonts |
file position: 0.
tag := file next: 4.
+ tag caseOf: {
- tag caseOf:{
['true' asByteArray] -> ["Version 1.0 TTF file"
"http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html
The values 'true' (0x74727565) and 0x00010000 are recognized by the Mac OS
as referring to TrueType fonts."
^Array with: 0 "only one font"
].
[#[0 1 0 0]] -> ["Version 1.0 TTF file"
^Array with: 0 "only one font"
].
['ttcf' asByteArray] -> ["TTC file"
version := file next: 4.
+ (version = #[0 1 0 0] or: [version = #[0 2 0 0]]) ifFalse: [^self error: 'Unsupported TTC version'].
- version = #(0 1 0 0) asByteArray ifFalse:[^self error: 'Unsupported TTC version'].
nFonts := file nextNumber: 4.
+ ^(1 to: nFonts) collect: [:i | file nextNumber: 4].
- ^(1 to: nFonts) collect:[:i| file nextNumber: 4].
].
} otherwise:[
self error: 'This is not a valid Truetype file'.
].!