-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from svenvc/master
Update zinc version
- Loading branch information
Showing
334 changed files
with
997 additions
and
770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
repository/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/int16.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
int16 | ||
^ self nextIntegerOfSize: 2 signed: true bigEndian: true |
2 changes: 1 addition & 1 deletion
2
repository/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/int32.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
int32 | ||
^ self nextIntegerOfSize: 4 signed: true bigEndian: true |
2 changes: 1 addition & 1 deletion
2
repository/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/int8.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
int8 | ||
^ self nextIntegerOfSize: 1 signed: true bigEndian: true |
2 changes: 1 addition & 1 deletion
2
...ory/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/nextInt32.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextInt32 | ||
^ self nextIntegerOfSize: 4 signed: true bigEndian: true |
2 changes: 1 addition & 1 deletion
2
...g-Core.package/ZnBufferedReadStream.class/instance/nextIntegerOfSize.signed.bigEndian..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...cter-Encoding-Core.package/ZnBufferedReadStream.class/instance/nextLittleEndianNumber..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextLittleEndianNumber: numberOfBytes | ||
^ self nextIntegerOfSize: numberOfBytes signed: false bigEndian: false |
2 changes: 1 addition & 1 deletion
2
...y/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/nextNumber..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextNumber: numberOfBytes | ||
^ self nextIntegerOfSize: numberOfBytes signed: false bigEndian: true |
2 changes: 1 addition & 1 deletion
2
...tory/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/nextWord.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextWord | ||
^ self nextIntegerOfSize: 2 signed: false bigEndian: true |
2 changes: 1 addition & 1 deletion
2
...tory/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/setToEnd.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
setToEnd | ||
|
||
stream setToEnd | ||
self position: stream size |
2 changes: 1 addition & 1 deletion
2
...sitory/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/uint16.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
uint16 | ||
^ self nextIntegerOfSize: 2 signed: false bigEndian: true |
2 changes: 1 addition & 1 deletion
2
...sitory/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/uint32.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
uint32 | ||
^ self nextIntegerOfSize: 4 signed: false bigEndian: true |
2 changes: 1 addition & 1 deletion
2
repository/Zinc-Character-Encoding-Core.package/ZnBufferedReadStream.class/instance/uint8.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
uint8 | ||
^ self nextIntegerOfSize: 1 signed: false bigEndian: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...itory/Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/int16..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
int16: integer | ||
^ self nextIntegerOfSize: 2 signed: true bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...itory/Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/int32..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
int32: integer | ||
^ self nextIntegerOfSize: 4 signed: true bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...sitory/Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/int8..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
int8: integer | ||
^ self nextIntegerOfSize: 1 signed: true bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...inc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/nextInt32Put..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextInt32Put: integer | ||
^ self nextIntegerOfSize: 4 signed: true bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...e.package/ZnBufferedWriteStream.class/instance/nextIntegerOfSize.signed.bigEndian.put..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Encoding-Core.package/ZnBufferedWriteStream.class/instance/nextLittleEndianNumber.put..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextLittleEndianNumber: numberOfBytes put: integer | ||
^ self nextIntegerOfSize: numberOfBytes signed: false bigEndian: false put: integer |
2 changes: 1 addition & 1 deletion
2
...c-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/nextNumber.put..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextNumber: numberOfBytes put: integer | ||
^ self nextIntegerOfSize: numberOfBytes signed: false bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/nextWordPut..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
nextWordPut: integer | ||
^ self nextIntegerOfSize: 2 signed: false bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...tory/Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/uint16..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
uint16: integer | ||
^ self nextIntegerOfSize: 2 signed: false bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...tory/Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/uint32..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
uint32: integer | ||
^ self nextIntegerOfSize: 4 signed: false bigEndian: true put: integer |
2 changes: 1 addition & 1 deletion
2
...itory/Zinc-Character-Encoding-Core.package/ZnBufferedWriteStream.class/instance/uint8..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing-bytes | ||
accessing - bytes | ||
uint8: integer | ||
^ self nextIntegerOfSize: 1 signed: false bigEndian: true put: integer |
5 changes: 0 additions & 5 deletions
5
...sitory/Zinc-Character-Encoding-Core.package/ZnCRLFReadStream.class/instance/initialize.st
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...sitory/Zinc-Character-Encoding-Core.package/ZnNewLineWriterStream.class/instance/flush.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing | ||
flushing | ||
flush | ||
^ stream flush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ory/Zinc-Character-Encoding-Core.package/ZnUTF16Encoder.class/instance/errorIncomplete.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
error handling | ||
errorIncomplete | ||
self error: 'Incomplete utf-16 encoding' |
3 changes: 3 additions & 0 deletions
3
...ory/Zinc-Character-Encoding-Core.package/ZnUTF32Encoder.class/instance/errorIncomplete.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
error handling | ||
errorIncomplete | ||
self error: 'Incomplete utf-32 encoding' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...-Character-Encoding-Tests.package/ZnBufferedReadStreamTest.class/instance/testSetToEnd.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tests | ||
testSetToEnd | ||
| stream source | | ||
source := '0123456789'. | ||
stream := ZnBufferedReadStream on: source readStream. | ||
stream sizeBuffer: source size. | ||
|
||
"Call setToEnd on new stream" | ||
self assert: stream position equals: 0. | ||
stream setToEnd. | ||
self assert: stream position equals: source size. | ||
|
||
"Call setToEnd without after reading some elements" | ||
stream position: 2. | ||
self assert: (stream next: 4) equals: '2345'. | ||
stream setToEnd. | ||
self assert: stream position equals: source size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tory/Zinc-Character-Encoding-Tests.package/ZnBufferedStreamByteTest.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
...aracter-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testLatin2Encoder.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
testing | ||
testLatin2Encoder | ||
"Example characters taken from http://en.wikipedia.org/wiki/Latin2" | ||
|
||
| encoder inputBytes outputBytes inputString outputString | | ||
encoder := ZnCharacterEncoder newForEncoding: 'latin2'. | ||
inputString := String | ||
with: (16r0154 asCharacter) with: (16r0110 asCharacter) | ||
with: ( 16r0155 asCharacter) with: (16r0111 asCharacter). | ||
inputBytes := #(192 208 224 240) asByteArray. | ||
inputString := String | ||
with: 16r0154 asCharacter | ||
with: 16r0110 asCharacter | ||
with: 16r0155 asCharacter | ||
with: 16r0111 asCharacter. | ||
inputBytes := #( 192 208 224 240 ) asByteArray. | ||
outputBytes := self encodeString: inputString with: encoder. | ||
self assert: outputBytes = inputBytes. | ||
self assert: outputBytes equals: inputBytes. | ||
outputString := self decodeBytes: inputBytes with: encoder. | ||
self assert: outputString = inputString | ||
self assert: outputString equals: inputString |
7 changes: 4 additions & 3 deletions
7
...Character-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testNullEncoder.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
testing | ||
testNullEncoder | ||
|
||
| encoder bytes string | | ||
encoder := ZnNullEncoder new. | ||
bytes := self encodeString: 'abc' with: encoder. | ||
self assert: bytes = #(97 98 99) asByteArray. | ||
string := self decodeBytes: #(65 66 67) asByteArray with: encoder. | ||
self assert: string = 'ABC' | ||
self assert: bytes equals: #( 97 98 99 ) asByteArray. | ||
string := self decodeBytes: #( 65 66 67 ) asByteArray with: encoder. | ||
self assert: string equals: 'ABC' |
16 changes: 11 additions & 5 deletions
16
...Character-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testUTF8Encoder.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
testing | ||
testUTF8Encoder | ||
|
||
"The examples are taken from http://en.wikipedia.org/wiki/UTF-8#Description" | ||
|
||
| encoder inputBytes outputBytes inputString outputString | | ||
encoder := ZnUTF8Encoder new. | ||
inputString := String with: $$ with: (16r00A2 asCharacter) with: (16r20AC asCharacter) with: (16r024B62 asCharacter). | ||
inputBytes := #(16r24 16rC2 16rA2 16rE2 16r82 16rAC 16rF0 16rA4 16rAD 16rA2) asByteArray. | ||
inputString := String | ||
with: $$ | ||
with: 16r00A2 asCharacter | ||
with: 16r20AC asCharacter | ||
with: 16r024B62 asCharacter. | ||
inputBytes := #( 16r24 16rC2 16rA2 16rE2 16r82 16rAC 16rF0 16rA4 | ||
16rAD 16rA2 ) asByteArray. | ||
outputBytes := self encodeString: inputString with: encoder. | ||
self assert: outputBytes = inputBytes. | ||
self assert: outputBytes equals: inputBytes. | ||
outputString := self decodeBytes: inputBytes with: encoder. | ||
self assert: outputString = inputString | ||
self assert: outputString equals: inputString |
9 changes: 6 additions & 3 deletions
9
...acter-Encoding-Tests.package/ZnCharacterEncoderTest.class/instance/testUTF8EncoderAuto.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
testing | ||
testUTF8EncoderAuto | ||
|
||
| encoder inputString bytes outputString | | ||
encoder := ZnUTF8Encoder new. | ||
inputString := String withAll: ((1 to: 3072) collect: [ :each | Character value: each ]). | ||
bytes := self encodeString: inputString with: encoder. | ||
inputString := String withAll: | ||
((1 to: 3072) collect: [ :each | | ||
Character value: each ]). | ||
bytes := self encodeString: inputString with: encoder. | ||
outputString := self decodeBytes: bytes with: encoder. | ||
self assert: inputString = outputString | ||
self assert: inputString equals: outputString |
Oops, something went wrong.