Skip to content

Commit 99f0712

Browse files
committed
- Added Ext type mapping hooks to MpDecodeTypeMapper and MpEncodeTypeDecoder
- MpDecoder and MpEncoder are now ready to support Ext types. Tests will be needed.
1 parent dd1c21e commit 99f0712

33 files changed

+157
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
actions for exts
2+
defineExtsActionsTo: map
3+
map at: MpConstants fixext1 put: #readFixext1.
4+
map at: MpConstants fixext1 put: #readFixext2.
5+
map at: MpConstants fixext1 put: #readFixext4.
6+
map at: MpConstants fixext1 put: #readFixext8.
7+
map at: MpConstants fixext1 put: #readFixext16.
8+
map at: MpConstants ext8 put: #readExt8.
9+
map at: MpConstants ext16 put: #readExt16.
10+
map at: MpConstants ext32 put: #readExt32.

repository/MessagePack-Core.package/MpDecodeTypeMapper.class/methodProperties.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"defineBinBytesActionTo:" : "mu 8/12/2013 00:43",
55
"defineCompoundsActionsTo:" : "mu 4/30/2011 22:33",
66
"defineDoubleActionTo:" : "mu 4/30/2011 22:44",
7+
"defineExtsActionsTo:" : "mu 11/5/2013 00:06",
78
"defineFalseActionTo:" : "mu 4/30/2011 22:43",
89
"defineFloatActionTo:" : "mu 4/30/2011 22:43",
910
"defineIntegerActionTo:" : "mu 4/30/2011 22:47",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
reading-ext
2+
readExt16
3+
| size type |
4+
size := MpPortableUtil default readUint16From: self readStream.
5+
type := self readStream next.
6+
^self readExtSized: size as: type
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
reading-ext
2+
readExt32
3+
| size type |
4+
size := MpPortableUtil default readUint32From: self readStream.
5+
type := self readStream next.
6+
^self readExtSized: size as: type
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
reading-ext
2+
readExt8
3+
| size type |
4+
size := self readStream next.
5+
type := self readStream next.
6+
^self readExtSized: size as: type
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reading-ext
2+
readExtSized: size as: type
3+
^MpExtValue typeCode: type data: (self readStream next: size)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reading-fixext
2+
readFixext: data as: type
3+
^MpFixextValue typeCode: type data: data
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
reading-fixext
2+
readFixext1
3+
| data type |
4+
type := self readStream next.
5+
data := self readStream next.
6+
^self readFixext: data as: type
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
reading-fixext
2+
readFixext16
3+
| data type |
4+
type := self readStream next.
5+
data := self readStream next: 16.
6+
^self readFixext: data as: type
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
reading-fixext
2+
readFixext2
3+
| data type |
4+
type := self readStream next.
5+
data := self readStream next: 2.
6+
^self readFixext: data as: type

0 commit comments

Comments
 (0)