Пример #1
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                switch (hash)
                {
                case 5393365:
                {
                    this.len = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 105:
                {
                    this.i = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 109:
                {
                    this.m = ((global::haxe.ds.ObjectMap <T, V>)(global::haxe.ds.ObjectMap <object, object> .__hx_cast <T, V>(((global::haxe.ds.ObjectMap)(@value)))));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                switch (hash)
                {
                case 5393365:
                {
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    this.len = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    return(@value);
                }


                case 105:
                {
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    this.i = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    return(@value);
                }


                case 109:
                {
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    this.m = ((global::haxe.ds.ObjectMap <K, T>)(global::haxe.ds.ObjectMap <object, object> .__hx_cast <K, T>(((global::haxe.ds.ObjectMap)(@value)))));
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    return(@value);
                }


                default:
                {
                                                #line 511 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
                        #line default
        }
Пример #3
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                switch (hash)
                {
                case 2146610825:
                {
                    this._stack = ((global::haxe.ds.GenericStack <object>)(global::haxe.ds.GenericStack <object> .__hx_cast <object>(((global::haxe.ds.GenericStack)(@value)))));
                    return(@value);
                }


                case 1072540152:
                {
                    this._relations = ((global::haxe.ds.ObjectMap <object, object>)(global::haxe.ds.ObjectMap <object, object> .__hx_cast <object, object>(((global::haxe.ds.ObjectMap)(@value)))));
                    return(@value);
                }


                case 463863666:
                {
                    this._nodes = ((global::haxe.ds.IntMap <object>)(global::haxe.ds.IntMap <object> .__hx_cast <object>(((global::haxe.ds.IntMap)(@value)))));
                    return(@value);
                }


                case 1946631881:
                {
                    this.graphId = global::haxe.lang.Runtime.toString(@value);
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
Пример #4
0
 public static global::haxe.ds.ObjectMap fromObjectMap(global::haxe.ds.ObjectMap map)
 {
                 #line 194 "C:\\HaxeToolkit\\haxe\\std\\haxe\\ds\\Map.hx"
     return((global::haxe.ds.ObjectMap)(map));
 }
 private static void __hx_ctor_haxe_ds__ObjectMap_ObjectMapValueIterator <K_c, T_c>(global::haxe.ds._ObjectMap.ObjectMapValueIterator <K_c, T_c> __hx_this, global::haxe.ds.ObjectMap <K_c, T_c> m)
 {
                 #line 517 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
     __hx_this.i = 0;
     __hx_this.m = m;
                 #line 519 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
     __hx_this.len = m.nBuckets;
 }
 public ObjectMapValueIterator(global::haxe.ds.ObjectMap <K, T> m)
 {
                 #line 516 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
     global::haxe.ds._ObjectMap.ObjectMapValueIterator <object, object> .__hx_ctor_haxe_ds__ObjectMap_ObjectMapValueIterator <K, T>(((global::haxe.ds._ObjectMap.ObjectMapValueIterator <K, T>)(this)), ((global::haxe.ds.ObjectMap <K, T>)(m)));
 }
 private static void __hx_ctor_haxe_ds__ObjectMap_ObjectMapKeyIterator <T_c, V_c>(global::haxe.ds._ObjectMap.ObjectMapKeyIterator <T_c, V_c> __hx_this, global::haxe.ds.ObjectMap <T_c, V_c> m)
 {
                 #line 482 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
     __hx_this.i = 0;
     __hx_this.m = m;
                 #line 484 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
     __hx_this.len = m.nBuckets;
 }
 public ObjectMapKeyIterator(global::haxe.ds.ObjectMap <T, V> m)
 {
                 #line 481 "/opt/haxe/std/cs/_std/haxe/ds/ObjectMap.hx"
     global::haxe.ds._ObjectMap.ObjectMapKeyIterator <object, object> .__hx_ctor_haxe_ds__ObjectMap_ObjectMapKeyIterator <T, V>(((global::haxe.ds._ObjectMap.ObjectMapKeyIterator <T, V>)(this)), ((global::haxe.ds.ObjectMap <T, V>)(m)));
 }
Пример #9
0
 public static void __hx_ctor_haxe_ds__ObjectMap_ObjectMapKeyIterator <T_c, V_c>(global::haxe.ds._ObjectMap.ObjectMapKeyIterator <T_c, V_c> __hx_this, global::haxe.ds.ObjectMap <T_c, V_c> m)
 {
     __hx_this.i   = 0;
     __hx_this.m   = m;
     __hx_this.len = m.nBuckets;
 }
Пример #10
0
        public virtual object haxe_ds_ObjectMap_cast <K_c, V_c>()
        {
            unchecked {
                if ((global::haxe.lang.Runtime.eq(typeof(K), typeof(K_c)) && global::haxe.lang.Runtime.eq(typeof(V), typeof(V_c))))
                {
                    return(this);
                }

                global::haxe.ds.ObjectMap <K_c, V_c> new_me = new global::haxe.ds.ObjectMap <K_c, V_c>(global::haxe.lang.EmptyObject.EMPTY);
                global::Array <object> fields = global::Reflect.fields(this);
                int i = 0;
                while ((i < fields.length))
                {
                    string field = global::haxe.lang.Runtime.toString(fields[i++]);
                    switch (field)
                    {
                    case "vals":
                    {
                        if ((this.vals != null))
                        {
                            V_c[] __temp_new_arr10 = new V_c[this.vals.Length];
                            int   __temp_i11       = -1;
                            while ((++__temp_i11 < this.vals.Length))
                            {
                                object __temp_obj12 = ((object)(this.vals[__temp_i11]));
                                if ((__temp_obj12 != null))
                                {
                                    __temp_new_arr10[__temp_i11] = global::haxe.lang.Runtime.genericCast <V_c>(__temp_obj12);
                                }
                            }

                            new_me.vals = __temp_new_arr10;
                        }
                        else
                        {
                            new_me.vals = null;
                        }

                        break;
                    }


                    case "_keys":
                    {
                        if ((this._keys != null))
                        {
                            K_c[] __temp_new_arr13 = new K_c[this._keys.Length];
                            int   __temp_i14       = -1;
                            while ((++__temp_i14 < this._keys.Length))
                            {
                                object __temp_obj15 = ((object)(this._keys[__temp_i14]));
                                if ((__temp_obj15 != null))
                                {
                                    __temp_new_arr13[__temp_i14] = global::haxe.lang.Runtime.genericCast <K_c>(__temp_obj15);
                                }
                            }

                            new_me._keys = __temp_new_arr13;
                        }
                        else
                        {
                            new_me._keys = null;
                        }

                        break;
                    }


                    default:
                    {
                        global::Reflect.setField(new_me, field, global::Reflect.field(this, field));
                        break;
                    }
                    }
                }

                return(new_me);
            }
        }
Пример #11
0
 public ObjectMapKeyIterator(global::haxe.ds.ObjectMap <T, V> m)
 {
     global::haxe.ds._ObjectMap.ObjectMapKeyIterator <object, object> .__hx_ctor_haxe_ds__ObjectMap_ObjectMapKeyIterator <T, V>(((global::haxe.ds._ObjectMap.ObjectMapKeyIterator <T, V>)(this)), ((global::haxe.ds.ObjectMap <T, V>)(m)));
 }
Пример #12
0
 public static object __hx_cast <K_c_c, V_c_c>(global::haxe.ds.ObjectMap me)
 {
     return(((me != null)) ? (me.haxe_ds_ObjectMap_cast <K_c_c, V_c_c>()) : default(object));
 }
Пример #13
0
 public static void __hx_ctor_haxe_ds_ObjectMap <K_c, V_c>(global::haxe.ds.ObjectMap <K_c, V_c> __hx_this)
 {
     unchecked {
         __hx_this.cachedIndex = -1;
     }
 }
Пример #14
0
 public static global::haxe.ds.ObjectMap <K, V> fromObjectMap <K, V>(global::haxe.ds.ObjectMap <K, V> map)
 {
                 #line 194 "/opt/haxe/std/haxe/ds/Map.hx"
     return((global::haxe.ds.ObjectMap <K, V>)(map));
 }
Пример #15
0
        public virtual object unserialize()
        {
            unchecked {
                {
                    int    p  = this.pos++;
                    string s  = this.buf;
                    int    _g = ((((bool)((((uint)(p)) < s.Length)))) ? (((int)(s[p]))) : (-1));
                    switch (_g)
                    {
                    case 65:
                    {
                        string name            = global::haxe.lang.Runtime.toString(this.unserialize());
                        global::System.Type cl = ((global::System.Type)(global::haxe.lang.Runtime.callField(this.resolver, "resolveClass", 14532012, new global::Array <object>(new object[] { name }))));
                        if (global::haxe.lang.Runtime.typeEq(cl, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Class not found ", name));
                        }

                        return(cl);
                    }


                    case 66:
                    {
                        string name1          = global::haxe.lang.Runtime.toString(this.unserialize());
                        global::System.Type e = ((global::System.Type)(global::haxe.lang.Runtime.callField(this.resolver, "resolveEnum", 1582403597, new global::Array <object>(new object[] { name1 }))));
                        if (global::haxe.lang.Runtime.typeEq(e, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Enum not found ", name1));
                        }

                        return(e);
                    }


                    case 67:
                    {
                        string name2            = global::haxe.lang.Runtime.toString(this.unserialize());
                        global::System.Type cl1 = ((global::System.Type)(global::haxe.lang.Runtime.callField(this.resolver, "resolveClass", 14532012, new global::Array <object>(new object[] { name2 }))));
                        if (global::haxe.lang.Runtime.typeEq(cl1, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Class not found ", name2));
                        }

                        object o = global::Type.createEmptyInstance <object>(((global::System.Type)(cl1)));
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { o }));
                        global::haxe.lang.Runtime.callField(o, "hxUnserialize", 112843575, new global::Array <object>(new object[] { this }));
                        int    p1 = this.pos++;
                        string s1 = this.buf;
                        if (((((((bool)((((uint)(p1)) < s1.Length)))) ? (((int)(s1[p1]))) : (-1))) != 103))
                        {
                            throw global::haxe.lang.HaxeException.wrap("Invalid custom data");
                        }

                        return(o);
                    }


                    case 77:
                    {
                        global::haxe.ds.ObjectMap h = new global::haxe.ds.ObjectMap <object, object>();
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { h }));
                        string buf = this.buf;
                        while (true)
                        {
                            int    p2 = this.pos;
                            string s2 = this.buf;
                            if (!((((((((bool)((((uint)(p2)) < s2.Length)))) ? (((int)(s2[p2]))) : (-1))) != 104))))
                            {
                                break;
                            }

                            object s3 = this.unserialize();
                            global::haxe.lang.Runtime.callField(h, "set", 5741474, new global::Array <object>(new object[] { s3, this.unserialize() }));
                        }

                        this.pos++;
                        return(h);
                    }


                    case 82:
                    {
                        int n = this.readDigits();
                        if (((n < 0) || (n >= this.scache.length)))
                        {
                            throw global::haxe.lang.HaxeException.wrap("Invalid string reference");
                        }

                        return(global::haxe.lang.Runtime.toString(this.scache[n]));
                    }


                    case 97:
                    {
                        string        buf1 = this.buf;
                        global::Array a    = new global::Array <object>();
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { a }));
                        while (true)
                        {
                            int    p3 = this.pos;
                            string s4 = this.buf;
                            int    c  = ((((bool)((((uint)(p3)) < s4.Length)))) ? (((int)(s4[p3]))) : (-1));
                            if ((c == 104))
                            {
                                this.pos++;
                                break;
                            }

                            if ((c == 117))
                            {
                                this.pos++;
                                int n1 = this.readDigits();
                                a[((((int)(global::haxe.lang.Runtime.getField_f(a, "length", 520590566, true))) + n1) - 1)] = null;
                            }
                            else
                            {
                                global::haxe.lang.Runtime.callField(a, "push", 1247875546, new global::Array <object>(new object[] { this.unserialize() }));
                            }
                        }

                        return(a);
                    }


                    case 98:
                    {
                        global::haxe.ds.StringMap h1 = new global::haxe.ds.StringMap <object>();
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { h1 }));
                        string buf2 = this.buf;
                        while (true)
                        {
                            int    p4 = this.pos;
                            string s5 = this.buf;
                            if (!((((((((bool)((((uint)(p4)) < s5.Length)))) ? (((int)(s5[p4]))) : (-1))) != 104))))
                            {
                                break;
                            }

                            string s6 = global::haxe.lang.Runtime.toString(this.unserialize());
                            global::haxe.lang.Runtime.callField(h1, "set", 5741474, new global::Array <object>(new object[] { s6, this.unserialize() }));
                        }

                        this.pos++;
                        return(h1);
                    }


                    case 99:
                    {
                        string name3            = global::haxe.lang.Runtime.toString(this.unserialize());
                        global::System.Type cl2 = ((global::System.Type)(global::haxe.lang.Runtime.callField(this.resolver, "resolveClass", 14532012, new global::Array <object>(new object[] { name3 }))));
                        if (global::haxe.lang.Runtime.typeEq(cl2, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Class not found ", name3));
                        }

                        object o1 = global::Type.createEmptyInstance <object>(((global::System.Type)(cl2)));
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { o1 }));
                        this.unserializeObject(o1);
                        return(o1);
                    }


                    case 100:
                    {
                        return(this.readFloat());
                    }


                    case 102:
                    {
                        return(false);
                    }


                    case 105:
                    {
                        return(this.readDigits());
                    }


                    case 106:
                    {
                        string name4 = global::haxe.lang.Runtime.toString(this.unserialize());
                        global::System.Type edecl = ((global::System.Type)(global::haxe.lang.Runtime.callField(this.resolver, "resolveEnum", 1582403597, new global::Array <object>(new object[] { name4 }))));
                        if (global::haxe.lang.Runtime.typeEq(edecl, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Enum not found ", name4));
                        }

                        this.pos++;
                        int    index = this.readDigits();
                        string tag   = global::haxe.lang.Runtime.toString(global::Type.getEnumConstructs(edecl)[index]);
                        if (string.Equals(tag, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Unknown enum index ", name4), "@"), global::haxe.lang.Runtime.toString(index)));
                        }

                        object e1 = this.unserializeEnum(edecl, tag);
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { e1 }));
                        return(e1);
                    }


                    case 107:
                    {
                        return(global::Math.NaN);
                    }


                    case 108:
                    {
                        global::List l = new global::List <object>();
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { l }));
                        string buf3 = this.buf;
                        while (true)
                        {
                            int    p5 = this.pos;
                            string s7 = this.buf;
                            if (!((((((((bool)((((uint)(p5)) < s7.Length)))) ? (((int)(s7[p5]))) : (-1))) != 104))))
                            {
                                break;
                            }

                            global::haxe.lang.Runtime.callField(l, "add", 4846113, new global::Array <object>(new object[] { this.unserialize() }));
                        }

                        this.pos++;
                        return(l);
                    }


                    case 109:
                    {
                        return(global::Math.NEGATIVE_INFINITY);
                    }


                    case 110:
                    {
                        return(null);
                    }


                    case 111:
                    {
                        object o2 = new global::haxe.lang.DynamicObject(new int[] {}, new object[] {}, new int[] {}, new double[] {});
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { o2 }));
                        this.unserializeObject(o2);
                        return(o2);
                    }


                    case 112:
                    {
                        return(global::Math.POSITIVE_INFINITY);
                    }


                    case 113:
                    {
                        global::haxe.ds.IntMap h2 = new global::haxe.ds.IntMap <object>();
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { h2 }));
                        string buf4 = this.buf;
                        int    p6   = this.pos++;
                        string s8   = this.buf;
                        int    c1   = ((((bool)((((uint)(p6)) < s8.Length)))) ? (((int)(s8[p6]))) : (-1));
                        while ((c1 == 58))
                        {
                            int i = this.readDigits();
                            global::haxe.lang.Runtime.callField(h2, "set", 5741474, new global::Array <object>(new object[] { i, this.unserialize() }));
                            int    p7 = this.pos++;
                            string s9 = this.buf;
                            if (((bool)((((uint)(p7)) < s9.Length))))
                            {
                                c1 = ((int)(s9[p7]));
                            }
                            else
                            {
                                c1 = -1;
                            }
                        }

                        if ((c1 != 104))
                        {
                            throw global::haxe.lang.HaxeException.wrap("Invalid IntMap format");
                        }

                        return(h2);
                    }


                    case 114:
                    {
                        int n2 = this.readDigits();
                        if (((n2 < 0) || (global::haxe.lang.Runtime.compare(n2, ((int)(global::haxe.lang.Runtime.getField_f(this.cache, "length", 520590566, true)))) >= 0)))
                        {
                            throw global::haxe.lang.HaxeException.wrap("Invalid reference");
                        }

                        return(this.cache[n2]);
                    }


                    case 115:
                    {
                        int    len  = this.readDigits();
                        string buf5 = this.buf;
                        bool   tmp  = default(bool);
                        int    p8   = this.pos++;
                        string s10  = this.buf;
                        if (((((((bool)((((uint)(p8)) < s10.Length)))) ? (((int)(s10[p8]))) : (-1))) == 58))
                        {
                            tmp = ((this.length - this.pos) < len);
                        }
                        else
                        {
                            tmp = true;
                        }

                        if (tmp)
                        {
                            throw global::haxe.lang.HaxeException.wrap("Invalid bytes length");
                        }

                        global::Array <int> codes = global::haxe.Unserializer.CODES;
                        if ((codes == null))
                        {
                            codes = global::haxe.Unserializer.initCodes();
                            global::haxe.Unserializer.CODES = codes;
                        }

                        int i1   = this.pos;
                        int rest = (len & 3);
                        int size = ((((len >> 2)) * 3) + ((((rest >= 2)) ? ((rest - 1)) : (0))));
                        int max  = (i1 + ((len - rest)));
                        global::haxe.io.Bytes bytes = global::haxe.io.Bytes.alloc(size);
                        int bpos = 0;
                        while ((i1 < max))
                        {
                            int index1 = i1++;
                            int c11    = codes[((((bool)((((uint)(index1)) < buf5.Length)))) ? (((int)(buf5[index1]))) : (-1))];
                            int index2 = i1++;
                            int c2     = codes[((((bool)((((uint)(index2)) < buf5.Length)))) ? (((int)(buf5[index2]))) : (-1))];
                            bytes.b[bpos++] = ((byte)(((c11 << 2) | (c2 >> 4))));
                            int index3 = i1++;
                            int c3     = codes[((((bool)((((uint)(index3)) < buf5.Length)))) ? (((int)(buf5[index3]))) : (-1))];
                            bytes.b[bpos++] = ((byte)(((c2 << 4) | (c3 >> 2))));
                            int index4 = i1++;
                            int c4     = codes[((((bool)((((uint)(index4)) < buf5.Length)))) ? (((int)(buf5[index4]))) : (-1))];
                            bytes.b[bpos++] = ((byte)(((c3 << 6) | c4)));
                        }

                        if ((rest >= 2))
                        {
                            int index5 = i1++;
                            int c12    = codes[((((bool)((((uint)(index5)) < buf5.Length)))) ? (((int)(buf5[index5]))) : (-1))];
                            int index6 = i1++;
                            int c21    = codes[((((bool)((((uint)(index6)) < buf5.Length)))) ? (((int)(buf5[index6]))) : (-1))];
                            bytes.b[bpos++] = ((byte)(((c12 << 2) | (c21 >> 4))));
                            if ((rest == 3))
                            {
                                int index7 = i1++;
                                int c31    = codes[((((bool)((((uint)(index7)) < buf5.Length)))) ? (((int)(buf5[index7]))) : (-1))];
                                bytes.b[bpos++] = ((byte)(((c21 << 4) | (c31 >> 2))));
                            }
                        }

                        this.pos += len;
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { bytes }));
                        return(bytes);
                    }


                    case 116:
                    {
                        return(true);
                    }


                    case 118:
                    {
                        global::Date d    = null;
                        bool         tmp1 = default(bool);
                        bool         tmp2 = default(bool);
                        bool         tmp3 = default(bool);
                        bool         tmp4 = default(bool);
                        bool         tmp5 = default(bool);
                        bool         tmp6 = default(bool);
                        bool         tmp7 = default(bool);
                        bool         tmp8 = default(bool);
                        int          p9   = this.pos;
                        string       s11  = this.buf;
                        if (((((((bool)((((uint)(p9)) < s11.Length)))) ? (((int)(s11[p9]))) : (-1))) >= 48))
                        {
                            int    p10 = this.pos;
                            string s12 = this.buf;
                            tmp8 = ((((((bool)((((uint)(p10)) < s12.Length)))) ? (((int)(s12[p10]))) : (-1))) <= 57);
                        }
                        else
                        {
                            tmp8 = false;
                        }

                        if (tmp8)
                        {
                            int    p11 = (this.pos + 1);
                            string s13 = this.buf;
                            tmp7 = ((((((bool)((((uint)(p11)) < s13.Length)))) ? (((int)(s13[p11]))) : (-1))) >= 48);
                        }
                        else
                        {
                            tmp7 = false;
                        }

                        if (tmp7)
                        {
                            int    p12 = (this.pos + 1);
                            string s14 = this.buf;
                            tmp6 = ((((((bool)((((uint)(p12)) < s14.Length)))) ? (((int)(s14[p12]))) : (-1))) <= 57);
                        }
                        else
                        {
                            tmp6 = false;
                        }

                        if (tmp6)
                        {
                            int    p13 = (this.pos + 2);
                            string s15 = this.buf;
                            tmp5 = ((((((bool)((((uint)(p13)) < s15.Length)))) ? (((int)(s15[p13]))) : (-1))) >= 48);
                        }
                        else
                        {
                            tmp5 = false;
                        }

                        if (tmp5)
                        {
                            int    p14 = (this.pos + 2);
                            string s16 = this.buf;
                            tmp4 = ((((((bool)((((uint)(p14)) < s16.Length)))) ? (((int)(s16[p14]))) : (-1))) <= 57);
                        }
                        else
                        {
                            tmp4 = false;
                        }

                        if (tmp4)
                        {
                            int    p15 = (this.pos + 3);
                            string s17 = this.buf;
                            tmp3 = ((((((bool)((((uint)(p15)) < s17.Length)))) ? (((int)(s17[p15]))) : (-1))) >= 48);
                        }
                        else
                        {
                            tmp3 = false;
                        }

                        if (tmp3)
                        {
                            int    p16 = (this.pos + 3);
                            string s18 = this.buf;
                            tmp2 = ((((((bool)((((uint)(p16)) < s18.Length)))) ? (((int)(s18[p16]))) : (-1))) <= 57);
                        }
                        else
                        {
                            tmp2 = false;
                        }

                        if (tmp2)
                        {
                            int    p17 = (this.pos + 4);
                            string s19 = this.buf;
                            tmp1 = ((((((bool)((((uint)(p17)) < s19.Length)))) ? (((int)(s19[p17]))) : (-1))) == 45);
                        }
                        else
                        {
                            tmp1 = false;
                        }

                        if (tmp1)
                        {
                            d         = global::Date.fromString(global::haxe.lang.StringExt.substr(this.buf, this.pos, new global::haxe.lang.Null <int>(19, true)));
                            this.pos += 19;
                        }
                        else
                        {
                            double t = this.readFloat();
                            d = new global::Date(((global::System.DateTime)(global::System.TimeZone.CurrentTimeZone.ToLocalTime(((global::System.DateTime)(new global::System.DateTime(((long)((((long)((t * ((double)(global::System.TimeSpan.TicksPerMillisecond))))) + ((long)(global::Date.epochTicks))))))))))));
                        }

                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { d }));
                        return(d);
                    }


                    case 119:
                    {
                        string name5 = global::haxe.lang.Runtime.toString(this.unserialize());
                        global::System.Type edecl1 = ((global::System.Type)(global::haxe.lang.Runtime.callField(this.resolver, "resolveEnum", 1582403597, new global::Array <object>(new object[] { name5 }))));
                        if (global::haxe.lang.Runtime.typeEq(edecl1, null))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Enum not found ", name5));
                        }

                        object e2 = this.unserializeEnum(edecl1, global::haxe.lang.Runtime.toString(this.unserialize()));
                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { e2 }));
                        return(e2);
                    }


                    case 120:
                    {
                        throw global::haxe.lang.HaxeException.wrap(this.unserialize());
                    }


                    case 121:
                    {
                        int    len1 = this.readDigits();
                        bool   tmp9 = default(bool);
                        int    p18  = this.pos++;
                        string s20  = this.buf;
                        if (((((((bool)((((uint)(p18)) < s20.Length)))) ? (((int)(s20[p18]))) : (-1))) == 58))
                        {
                            tmp9 = ((this.length - this.pos) < len1);
                        }
                        else
                        {
                            tmp9 = true;
                        }

                        if (tmp9)
                        {
                            throw global::haxe.lang.HaxeException.wrap("Invalid string length");
                        }

                        string s21 = global::haxe.lang.StringExt.substr(this.buf, this.pos, new global::haxe.lang.Null <int>(len1, true));
                        this.pos += len1;
                        s21       = global::System.Uri.UnescapeDataString(((string)(s21)));
                        this.scache.push(s21);
                        return(s21);
                    }


                    case 122:
                    {
                        return(0);
                    }


                    default:
                    {
                        break;
                    }
                    }
                }

                this.pos--;
                throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Invalid char ", global::haxe.lang.StringExt.charAt(this.buf, this.pos)), " at position "), global::haxe.lang.Runtime.toString(this.pos)));
            }
        }
Пример #16
0
        public virtual void serialize(object v)
        {
            unchecked {
                global::ValueType _g = global::Type.@typeof(v);
                switch (_g.index)
                {
                case 0:
                {
                    this.buf.b.Append(((string)("n")));
                    break;
                }


                case 1:
                {
                    int v1 = ((int)(global::haxe.lang.Runtime.toInt(v)));
                    if ((v1 == 0))
                    {
                        this.buf.b.Append(((string)("z")));
                        return;
                    }

                    this.buf.b.Append(((string)("i")));
                    this.buf.b.Append(((string)(global::Std.@string(v1))));
                    break;
                }


                case 2:
                {
                    double v2 = ((double)(global::haxe.lang.Runtime.toDouble(v)));
                    if (global::System.Double.IsNaN(((double)(v2))))
                    {
                        this.buf.b.Append(((string)("k")));
                    }
                    else if (!(((!(global::System.Double.IsInfinity(((double)(v2)))) && !(global::System.Double.IsNaN(((double)(v2))))))))
                    {
                        this.buf.b.Append(((string)((((v2 < 0)) ? ("m") : ("p")))));
                    }
                    else
                    {
                        this.buf.b.Append(((string)("d")));
                        this.buf.b.Append(((string)(global::Std.@string(v2))));
                    }

                    break;
                }


                case 3:
                {
                    this.buf.b.Append(((string)(((global::haxe.lang.Runtime.toBool((v))) ? ("t") : ("f")))));
                    break;
                }


                case 4:
                {
                    if ((v is global::System.Type))
                    {
                        string className = global::Type.getClassName(((global::System.Type)(v)));
                        this.buf.b.Append(((string)("A")));
                        this.serializeString(className);
                    }
                    else if ((v is global::System.Type))
                    {
                        this.buf.b.Append(((string)("B")));
                        this.serializeString(global::Type.getEnumName(((global::System.Type)(v))));
                    }
                    else
                    {
                        if ((this.useCache && this.serializeRef(v)))
                        {
                            return;
                        }

                        this.buf.b.Append(((string)("o")));
                        this.serializeFields(v);
                    }

                    break;
                }


                case 5:
                {
                    throw global::haxe.lang.HaxeException.wrap("Cannot serialize function");
                }


                case 6:
                {
                    global::System.Type c = ((global::System.Type)(_g.@params[0]));
                    {
                        if (global::haxe.lang.Runtime.refEq(c, typeof(string)))
                        {
                            this.serializeString(global::haxe.lang.Runtime.toString(v));
                            return;
                        }

                        if ((this.useCache && this.serializeRef(v)))
                        {
                            return;
                        }

                        {
                            string _g1 = global::Type.getClassName(c);
                            switch (_g1)
                            {
                            case "Array":
                            {
                                int ucount = 0;
                                this.buf.b.Append(((string)("a")));
                                int l = ((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.getField(v, "length", 520590566, true))));
                                {
                                    int _g11 = 0;
                                    int _g2  = l;
                                    while ((_g11 < _g2))
                                    {
                                        int i = _g11++;
                                        if ((((object)(global::haxe.lang.Runtime.callField(v, "__get", 1915412854, new global::Array <object>(new object[] { i })))) == null))
                                        {
                                            ++ucount;
                                        }
                                        else
                                        {
                                            if ((ucount > 0))
                                            {
                                                if ((ucount == 1))
                                                {
                                                    this.buf.b.Append(((string)("n")));
                                                }
                                                else
                                                {
                                                    this.buf.b.Append(((string)("u")));
                                                    this.buf.b.Append(((string)(global::Std.@string(ucount))));
                                                }

                                                ucount = 0;
                                            }

                                            this.serialize(((object)(global::haxe.lang.Runtime.callField(v, "__get", 1915412854, new global::Array <object>(new object[] { i })))));
                                        }
                                    }
                                }

                                if ((ucount > 0))
                                {
                                    if ((ucount == 1))
                                    {
                                        this.buf.b.Append(((string)("n")));
                                    }
                                    else
                                    {
                                        this.buf.b.Append(((string)("u")));
                                        this.buf.b.Append(((string)(global::Std.@string(ucount))));
                                    }
                                }

                                this.buf.b.Append(((string)("h")));
                                break;
                            }


                            case "Date":
                            {
                                global::Date d = ((global::Date)(v));
                                this.buf.b.Append(((string)("v")));
                                {
                                    global::StringBuf _this = this.buf;
                                    long a = global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(d.date))).Ticks;
                                    _this.b.Append(((string)(global::Std.@string((((double)(((long)((((long)(a)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond)))))));
                                }

                                break;
                            }


                            case "List":
                            {
                                this.buf.b.Append(((string)("l")));
                                global::List v3 = ((global::List)(v));
                                {
                                    global::_List.ListNode _g_head = ((global::_List.ListNode)(global::haxe.lang.Runtime.getField(v3, "h", 104, true)));
                                    while ((_g_head != null))
                                    {
                                        object val = global::haxe.lang.Runtime.getField(_g_head, "item", 1170195731, true);
                                        _g_head = ((global::_List.ListNode)(global::haxe.lang.Runtime.getField(_g_head, "next", 1224901875, true)));
                                        object i1 = ((object)(val));
                                        this.serialize(i1);
                                    }
                                }

                                this.buf.b.Append(((string)("h")));
                                break;
                            }


                            case "haxe.ds.IntMap":
                            {
                                this.buf.b.Append(((string)("q")));
                                global::haxe.ds.IntMap v4 = ((global::haxe.ds.IntMap)(v));
                                {
                                    object k = ((object)(new global::haxe.ds._IntMap.IntMapKeyIterator <object>(((global::haxe.ds.IntMap <object>)(global::haxe.ds.IntMap <object> .__hx_cast <object>(((global::haxe.ds.IntMap)(v4))))))));
                                    while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(k, "hasNext", 407283053, null)))
                                    {
                                        int k1 = ((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.callField(k, "next", 1224901875, null))));
                                        this.buf.b.Append(((string)(":")));
                                        this.buf.b.Append(((string)(global::Std.@string(k1))));
                                        this.serialize(((object)(global::haxe.lang.Runtime.callField(v4, "get", 5144726, new global::Array <object>(new object[] { k1 })))));
                                    }
                                }

                                this.buf.b.Append(((string)("h")));
                                break;
                            }


                            case "haxe.ds.ObjectMap":
                            {
                                this.buf.b.Append(((string)("M")));
                                global::haxe.ds.ObjectMap v5 = ((global::haxe.ds.ObjectMap)(v));
                                {
                                    object k2 = v5.keys();
                                    while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(k2, "hasNext", 407283053, null)))
                                    {
                                        object k3 = ((object)(global::haxe.lang.Runtime.callField(k2, "next", 1224901875, null)));
                                        this.serialize(k3);
                                        this.serialize(((object)(global::haxe.lang.Runtime.callField(v5, "get", 5144726, new global::Array <object>(new object[] { k3 })))));
                                    }
                                }

                                this.buf.b.Append(((string)("h")));
                                break;
                            }


                            case "haxe.ds.StringMap":
                            {
                                this.buf.b.Append(((string)("b")));
                                global::haxe.ds.StringMap v6 = ((global::haxe.ds.StringMap)(v));
                                {
                                    object k4 = ((object)(new global::haxe.ds._StringMap.StringMapKeyIterator <object>(((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(v6))))))));
                                    while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(k4, "hasNext", 407283053, null)))
                                    {
                                        string k5 = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(k4, "next", 1224901875, null));
                                        this.serializeString(k5);
                                        this.serialize(((object)(global::haxe.lang.Runtime.callField(v6, "get", 5144726, new global::Array <object>(new object[] { k5 })))));
                                    }
                                }

                                this.buf.b.Append(((string)("h")));
                                break;
                            }


                            case "haxe.io.Bytes":
                            {
                                global::haxe.io.Bytes v7 = ((global::haxe.io.Bytes)(v));
                                this.buf.b.Append(((string)("s")));
                                {
                                    global::StringBuf _this1 = this.buf;
                                    int x = ((int)(global::System.Math.Ceiling(((double)((((double)((v7.length * 8))) / 6))))));
                                    _this1.b.Append(((string)(global::Std.@string(x))));
                                }

                                this.buf.b.Append(((string)(":")));
                                int i2  = 0;
                                int max = (v7.length - 2);
                                global::haxe.lang.Null <int>[] b64 = global::haxe.Serializer.BASE64_CODES;
                                if ((b64 == null))
                                {
                                    global::haxe.lang.Null <int>[] this1 = new global::haxe.lang.Null <int> [global::haxe.Serializer.BASE64.Length];
                                    b64 = ((global::haxe.lang.Null <int>[])(this1));
                                    {
                                        int _g12 = 0;
                                        int _g3  = global::haxe.Serializer.BASE64.Length;
                                        while ((_g12 < _g3))
                                        {
                                            int i3 = _g12++;
                                            ((global::haxe.lang.Null <int>[])(b64))[i3] = global::haxe.lang.StringExt.charCodeAt(global::haxe.Serializer.BASE64, i3);
                                        }
                                    }

                                    global::haxe.Serializer.BASE64_CODES = b64;
                                }

                                while ((i2 < max))
                                {
                                    int b1 = ((int)(v7.b[i2++]));
                                    int b2 = ((int)(v7.b[i2++]));
                                    int b3 = ((int)(v7.b[i2++]));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[(b1 >> 2)]).@value)));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[((((b1 << 4) | (b2 >> 4))) & 63)]).@value)));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[((((b2 << 2) | (b3 >> 6))) & 63)]).@value)));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[(b3 & 63)]).@value)));
                                }

                                if ((i2 == max))
                                {
                                    int b11 = ((int)(v7.b[i2++]));
                                    int b21 = ((int)(v7.b[i2++]));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[(b11 >> 2)]).@value)));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[((((b11 << 4) | (b21 >> 4))) & 63)]).@value)));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[((b21 << 2) & 63)]).@value)));
                                }
                                else if ((i2 == (max + 1)))
                                {
                                    int b12 = ((int)(v7.b[i2++]));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[(b12 >> 2)]).@value)));
                                    this.buf.b.Append(((char)((((global::haxe.lang.Null <int>[])(b64))[((b12 << 4) & 63)]).@value)));
                                }

                                break;
                            }


                            default:
                            {
                                if (this.useCache)
                                {
                                    global::haxe.lang.Runtime.callField(this.cache, "pop", 5594513, null);
                                }

                                if (global::Reflect.hasField(v, "hxSerialize"))
                                {
                                    this.buf.b.Append(((string)("C")));
                                    this.serializeString(global::Type.getClassName(c));
                                    if (this.useCache)
                                    {
                                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { v }));
                                    }

                                    global::haxe.lang.Runtime.callField(v, "hxSerialize", 336134320, new global::Array <object>(new object[] { this }));
                                    this.buf.b.Append(((string)("g")));
                                }
                                else
                                {
                                    this.buf.b.Append(((string)("c")));
                                    this.serializeString(global::Type.getClassName(c));
                                    if (this.useCache)
                                    {
                                        global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { v }));
                                    }

                                    this.serializeFields(v);
                                }

                                break;
                            }
                            }
                        }
                    }

                    break;
                }


                case 7:
                {
                    global::System.Type e = ((global::System.Type)(_g.@params[0]));
                    {
                        if (this.useCache)
                        {
                            if (this.serializeRef(v))
                            {
                                return;
                            }

                            global::haxe.lang.Runtime.callField(this.cache, "pop", 5594513, null);
                        }

                        this.buf.b.Append(((string)(global::Std.@string(((this.useEnumIndex) ? ("j") : ("w"))))));
                        this.serializeString(global::Type.getEnumName(e));
                        if (this.useEnumIndex)
                        {
                            this.buf.b.Append(((string)(":")));
                            this.buf.b.Append(((string)(global::Std.@string(global::Type.enumIndex(v)))));
                        }
                        else
                        {
                            this.serializeString(global::Type.enumConstructor(v));
                        }

                        this.buf.b.Append(((string)(":")));
                        global::Array arr = global::Type.enumParameters(v);
                        if ((arr != null))
                        {
                            this.buf.b.Append(((string)(global::Std.@string(((int)(global::haxe.lang.Runtime.getField_f(arr, "length", 520590566, true)))))));
                            {
                                int _g4 = 0;
                                while ((global::haxe.lang.Runtime.compare(_g4, ((int)(global::haxe.lang.Runtime.getField_f(arr, "length", 520590566, true)))) < 0))
                                {
                                    object v8 = arr[_g4];
                                    ++_g4;
                                    this.serialize(v8);
                                }
                            }
                        }
                        else
                        {
                            this.buf.b.Append(((string)("0")));
                        }

                        if (this.useCache)
                        {
                            global::haxe.lang.Runtime.callField(this.cache, "push", 1247875546, new global::Array <object>(new object[] { v }));
                        }
                    }

                    break;
                }


                default:
                {
                    throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Cannot serialize ", global::Std.@string(v)));
                }
                }
            }
        }