コード例 #1
0
        public static object decode(global::haxe.io.Bytes b, global::org.msgpack.DecodeOption option)
        {
                        #line 19 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\MsgPack.hx"
            if ((option == null))
            {
                                #line 20 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\MsgPack.hx"
                option = global::org.msgpack.DecodeOption.AsObject;
            }

                        #line 22 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\MsgPack.hx"
            return(new global::org.msgpack.Decoder(b, option).o);
        }
コード例 #2
0
        public virtual object readMap(global::haxe.io.BytesInput i, int length, global::org.msgpack.DecodeOption option)
        {
            unchecked {
                                #line 116 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                switch (option._hx_index)
                {
                case 0:
                {
                                                #line 128 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    global::haxe.root.Array pairs = new global::haxe.root.Array(new object[] {});
                    {
                                                        #line 129 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        int _g = 0;
                                                        #line 129 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        int _g1 = length;
                                                        #line 129 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        while ((_g < _g1))
                        {
                                                                #line 129 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            int    n = _g++;
                            object k = this.decode(i, option);
                                                                #line 131 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            object v = this.decode(i, option);
                            pairs.push(new global::org.msgpack._Decoder.Pair(k, v));
                        }
                    }

                                                #line 135 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    if ((pairs.length == 0))
                    {
                                                        #line 136 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(new global::haxe.ds.StringMap());
                    }

                                                #line 138 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    global::haxe.root.ValueType _g2 = global::haxe.root.Type.@typeof(((global::org.msgpack._Decoder.Pair)(pairs.__get(0))).k);
                                                #line 138 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    switch (_g2._hx_index)
                    {
                    case 1:
                    {
                                                                #line 141 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        global::haxe.ds.IntMap @out = new global::haxe.ds.IntMap();
                        {
                                                                        #line 142 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            int _g21 = 0;
                                                                        #line 142 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            while ((_g21 < pairs.length))
                            {
                                                                                #line 142 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                global::org.msgpack._Decoder.Pair p = ((global::org.msgpack._Decoder.Pair)(pairs.__get(_g21)));
                                                                                #line 142 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                ++_g21;
                                if ((global::haxe.root.Type.@typeof(p.k)._hx_index == 1))
                                {
                                }
                                else
                                {
                                                                                        #line 146 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                    throw global::haxe.lang.HaxeException.wrap("Error: Mixed key type when decoding IntMap");
                                }

                                                                                #line 149 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                if (@out.exists(((int)(global::haxe.lang.Runtime.toInt(p.k)))))
                                {
                                                                                        #line 150 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                    throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Error: Duplicate keys found => ", global::haxe.root.Std.@string(p.k)));
                                }

                                                                                #line 152 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                @out.@set(((int)(global::haxe.lang.Runtime.toInt(p.k))), ((object)(p.v)));
                            }
                        }

                                                                #line 155 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(@out);
                    }


                    case 6:
                    {
                                                                #line 157 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        global::System.Type c = (_g2 as global::haxe.root.ValueType_TClass).c;
                                                                #line 157 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        if ((global::haxe.root.Type.getClassName(c) == "String"))
                        {
                                                                        #line 158 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            global::haxe.ds.StringMap out1 = new global::haxe.ds.StringMap();
                            {
                                                                                #line 159 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                int _g22 = 0;
                                                                                #line 159 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                while ((_g22 < pairs.length))
                                {
                                                                                        #line 159 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                    global::org.msgpack._Decoder.Pair p1 = ((global::org.msgpack._Decoder.Pair)(pairs.__get(_g22)));
                                                                                        #line 159 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                    ++_g22;
                                    {
                                                                                                #line 160 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                        global::haxe.root.ValueType _g23 = global::haxe.root.Type.@typeof(p1.k);
                                                                                                #line 160 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                        if ((_g23._hx_index == 6))
                                        {
                                                                                                        #line 161 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                            global::System.Type c1 = (_g23 as global::haxe.root.ValueType_TClass).c;
                                                                                                        #line 161 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                            if ((global::haxe.root.Type.getClassName(c1) == "String"))
                                            {
                                            }
                                            else
                                            {
                                                                                                                #line 163 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                                throw global::haxe.lang.HaxeException.wrap("Error: Mixed key type when decoding StringMap");
                                            }
                                        }
                                        else
                                        {
                                                                                                        #line 163 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                            throw global::haxe.lang.HaxeException.wrap("Error: Mixed key type when decoding StringMap");
                                        }
                                    }

                                                                                        #line 166 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                    if (out1.exists(global::haxe.lang.Runtime.toString(p1.k)))
                                    {
                                                                                                #line 167 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                        throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Error: Duplicate keys found => ", global::haxe.root.Std.@string(p1.k)));
                                    }

                                                                                        #line 169 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                                    out1.@set(global::haxe.lang.Runtime.toString(p1.k), ((object)(p1.v)));
                                }
                            }

                                                                        #line 172 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(out1);
                        }
                        else
                        {
                                                                        #line 175 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            throw global::haxe.lang.HaxeException.wrap("Error: Unsupported key Type");
                        }
                    }


                    default:
                    {
                                                                #line 175 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        throw global::haxe.lang.HaxeException.wrap("Error: Unsupported key Type");
                    }
                    }
                }


                case 1:
                {
                                                #line 118 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    object out2 = new global::haxe.lang.DynamicObject(new int[] {}, new object[] {}, new int[] {}, new double[] {});
                    {
                                                        #line 119 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        int _g3 = 0;
                                                        #line 119 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        int _g11 = length;
                                                        #line 119 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        while ((_g3 < _g11))
                        {
                                                                #line 119 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            int    n1 = _g3++;
                            object k1 = this.decode(i, option);
                                                                #line 121 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            object v1 = this.decode(i, option);
                            global::haxe.root.Reflect.setField(out2, global::haxe.root.Std.@string(k1), v1);
                        }
                    }

                                                #line 125 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    return(out2);
                }
                }

                                #line 115 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                return(null);
            }
                        #line default
        }
コード例 #3
0
        public virtual global::haxe.root.Array readArray(global::haxe.io.BytesInput i, int length, global::org.msgpack.DecodeOption option)
        {
                        #line 107 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
            global::haxe.root.Array a = new global::haxe.root.Array(new object[] {});
            {
                                #line 108 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                int _g = 0;
                                #line 108 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                int _g1 = length;
                                #line 108 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                while ((_g < _g1))
                {
                                        #line 108 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    int x = _g++;
                    a.push(this.decode(i, option));
                }
            }

                        #line 111 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
            return(a);
        }
コード例 #4
0
        public virtual object decode(global::haxe.io.BytesInput i, global::org.msgpack.DecodeOption option)
        {
            unchecked {
                                #line 41 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                try {
                                        #line 42 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    int b = i.readByte();
                    switch (b)
                    {
                    case 192:
                    {
                                                        #line 45 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(null);
                    }


                    case 194:
                    {
                                                        #line 48 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(false);
                    }


                    case 195:
                    {
                                                        #line 49 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(true);
                    }


                    case 196:
                    {
                                                        #line 52 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(i.readByte()));
                    }


                    case 197:
                    {
                                                        #line 53 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(i.readUInt16()));
                    }


                    case 198:
                    {
                                                        #line 54 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(i.readInt32()));
                    }


                    case 202:
                    {
                                                        #line 57 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readFloat());
                    }


                    case 203:
                    {
                                                        #line 58 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readDouble());
                    }


                    case 204:
                    {
                                                        #line 61 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readByte());
                    }


                    case 205:
                    {
                                                        #line 62 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readUInt16());
                    }


                    case 206:
                    {
                                                        #line 63 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt32());
                    }


                    case 207:
                    {
                                                        #line 64 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        throw global::haxe.lang.HaxeException.wrap("UInt64 not supported");
                    }


                    case 208:
                    {
                                                        #line 67 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt8());
                    }


                    case 209:
                    {
                                                        #line 68 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt16());
                    }


                    case 210:
                    {
                                                        #line 69 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.readInt32());
                    }


                    case 211:
                    {
                                                        #line 70 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readInt64(i));
                    }


                    case 217:
                    {
                                                        #line 74 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        int len = i.readInt32();
                                                        #line 76 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(i.read(len).toString());
                    }


                    case 220:
                    {
                                                        #line 81 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readArray(i, i.readUInt16(), option));
                    }


                    case 221:
                    {
                                                        #line 82 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readArray(i, i.readInt32(), option));
                    }


                    case 222:
                    {
                                                        #line 85 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readMap(i, i.readUInt16(), option));
                    }


                    case 223:
                    {
                                                        #line 86 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        return(this.readMap(i, i.readInt32(), option));
                    }


                    default:
                    {
                                                        #line 89 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        if ((b < 128))
                        {
                                                                #line 89 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(b);
                        }
                        else if ((b < 144))
                        {
                                                                #line 90 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(this.readMap(i, (15 & b), option));
                        }
                        else if ((b < 160))
                        {
                                                                #line 91 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(this.readArray(i, (15 & b), option));
                        }
                        else if ((b < 192))
                        {
                                                                #line 92 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(i.readString((31 & b), null));
                        }
                        else if ((b > 223))
                        {
                                                                #line 93 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                            return(-256 | b);
                        }

                                                        #line 89 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        break;
                    }
                    }
                }
                catch (global::System.Exception catchallException) {
                                        #line 41 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    global::haxe.lang.Exceptions.exception = catchallException;
                                        #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    object realException = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                        #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                    if ((realException is global::haxe.io.Eof))
                    {
                                                #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(realException));
                    }
                    else
                    {
                                                #line 96 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                        throw;
                    }
                }


                                #line 97 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
                return(null);
            }
                        #line default
        }
コード例 #5
0
 protected static void __hx_ctor_org_msgpack_Decoder(global::org.msgpack.Decoder __hx_this, global::haxe.io.Bytes b, global::org.msgpack.DecodeOption option)
 {
                 #line 35 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
     global::haxe.io.BytesInput i = new global::haxe.io.BytesInput(b, null, null);
     i.set_bigEndian(true);
                 #line 37 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
     __hx_this.o = __hx_this.decode(i, option);
 }
コード例 #6
0
 public Decoder(global::haxe.io.Bytes b, global::org.msgpack.DecodeOption option)
 {
                 #line 34 "D:\\project\\sangong\\sangong\\src\\org\\msgpack\\Decoder.hx"
     global::org.msgpack.Decoder.__hx_ctor_org_msgpack_Decoder(this, b, option);
 }