public virtual void S_0001(bool bFirst) { unchecked { int sec = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))).date.Second; int n = (sec % 5); this.m_val = n; if ((n == 0)) { this.Goto(global::TestControl_STATE.S_0002); } else if ((n == 1)) { this.Goto(global::TestControl_STATE.S_0003); } else if ((n == 2)) { this.Goto(global::TestControl_STATE.S_0004); } else if ((n == 3)) { this.Goto(global::TestControl_STATE.S_0005); } else { this.Goto(global::TestControl_STATE.S_0006); } } }
public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch (tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (initialDate_ == null) { InitialDate = new global::Date(); } input.ReadMessage(InitialDate); break; } case 18: { if (finalDate_ == null) { FinalDate = new global::Date(); } input.ReadMessage(FinalDate); break; } } } }
public static global::Date date(global::Date earliest, global::Date latest) { double @from = (((double)(((long)((((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(earliest.date))).Ticks)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond))); double t = (@from + ((((((double)(((long)((((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(latest.date))).Ticks)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond))) - @from)) * global::Math.rand.NextDouble())); return(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))))))))))))); }
protected static void __hx_ctor__Date(global::Date __hx_this, global::System.DateTime native) { if ((native.Kind == global::System.DateTimeKind.Utc)) { __hx_this.dateUTC = native; __hx_this.date = __hx_this.dateUTC.ToLocalTime(); } else { __hx_this.date = native; __hx_this.dateUTC = __hx_this.date.ToUniversalTime(); } }
public void MergeFrom(Person other) { if (other == null) { return; } if (other.Id != 0) { Id = other.Id; } if (other.Name.Length != 0) { Name = other.Name; } if (other.Height != 0F) { Height = other.Height; } if (other.Weight != 0F) { Weight = other.Weight; } if (other.Avator.Length != 0) { Avator = other.Avator; } if (other.Email.Length != 0) { Email = other.Email; } if (other.EmailVerified != false) { EmailVerified = other.EmailVerified; } phoneNumber_.Add(other.phoneNumber_); if (other.Gender != global::My.Project.Gender.NotSpecified) { Gender = other.Gender; } if (other.birthday_ != null) { if (birthday_ == null) { Birthday = new global::Date(); } Birthday.MergeFrom(other.Birthday); } addresses_.Add(other.addresses_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
protected static void __hx_ctor__Date(global::Date __hx_this, global::System.DateTime native) { #line 47 "/opt/haxe/std/cs/_std/Date.hx" if ((native.Kind == global::System.DateTimeKind.Utc)) { #line 48 "/opt/haxe/std/cs/_std/Date.hx" __hx_this.dateUTC = native; __hx_this.date = __hx_this.dateUTC.ToLocalTime(); } else { #line 51 "/opt/haxe/std/cs/_std/Date.hx" __hx_this.date = native; __hx_this.dateUTC = __hx_this.date.ToUniversalTime(); } }
public static void __hx_ctor__Date(global::Date __hx_this, int year, int month, int day, int hour, int min, int sec) { unchecked { if ((day <= 0)) { day = 1; } if ((year <= 0)) { year = 1; } __hx_this.date = new global::System.DateTime(year, (month + 1), day, hour, min, sec); } }
protected static void __hx_ctor__Date(global::Date __hx_this, int year, int month, int day, int hour, int min, int sec) { unchecked { if ((day <= 0)) { day = 1; } if ((year <= 0)) { year = 1; } __hx_this.date = new global::System.DateTime(((int)(year)), ((int)((month + 1))), ((int)(day)), ((int)(hour)), ((int)(min)), ((int)(sec)), ((global::System.DateTimeKind)(global::System.DateTimeKind.Local))); __hx_this.dateUTC = __hx_this.date.ToUniversalTime(); } }
public static object stat(string path) { #line 42 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" if (global::System.IO.File.Exists(((string)(path)))) { #line 43 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" global::System.IO.FileInfo fi = new global::System.IO.FileInfo(path); #line 47 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" global::Date tmp = new global::Date(((global::System.DateTime)((fi as global::System.IO.FileSystemInfo).LastAccessTime))); global::Date tmp1 = new global::Date(((global::System.DateTime)((fi as global::System.IO.FileSystemInfo).LastWriteTime))); #line 49 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" global::Date tmp2 = new global::Date(((global::System.DateTime)((fi as global::System.IO.FileSystemInfo).CreationTime))); #line 44 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" { #line 50 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" int __temp_odecl1 = ((int)(fi.Length)); #line 44 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" return(new global::haxe.lang.DynamicObject(new int[] { 262801146, 651890926, 1302870512 }, new object[] { tmp1, tmp, tmp2 }, new int[] { 4995541, 5145602, 5246186, 5841808, 499574632, 1214305123, 1269206179, 1280549057 }, new double[] { ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(__temp_odecl1)) })); } } else if (global::System.IO.Directory.Exists(((string)(path)))) { #line 58 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" global::System.IO.DirectoryInfo fi1 = new global::System.IO.DirectoryInfo(path); #line 62 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" global::Date tmp3 = new global::Date(((global::System.DateTime)((fi1 as global::System.IO.FileSystemInfo).LastAccessTime))); global::Date tmp4 = new global::Date(((global::System.DateTime)((fi1 as global::System.IO.FileSystemInfo).LastWriteTime))); #line 59 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" { #line 64 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" global::Date __temp_odecl2 = new global::Date(((global::System.DateTime)((fi1 as global::System.IO.FileSystemInfo).CreationTime))); #line 59 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" return(new global::haxe.lang.DynamicObject(new int[] { 262801146, 651890926, 1302870512 }, new object[] { tmp4, tmp3, __temp_odecl2 }, new int[] { 4995541, 5145602, 5246186, 5841808, 499574632, 1214305123, 1269206179, 1280549057 }, new double[] { ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)), ((double)(0)) })); } } else { #line 73 "/opt/haxe/std/cs/_std/sys/FileSystem.hx" throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Path \'", path), "\' doesn\'t exist")))); } }
public virtual void waitForRead() { unchecked { #line 126 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" global::Date _this = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))); #line 126 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" double end = ((((double)(((long)((((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(_this.date))).Ticks)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond))) + ((((this.sock.ReceiveTimeout <= 0)) ? (global::Math.POSITIVE_INFINITY) : (((double)(this.sock.ReceiveTimeout)))))); while (true) { #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" bool tmp = default(bool); #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" if ((this.sock.Available == 0)) { #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" global::Date _this1 = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))); #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" tmp = ((((double)(((long)((((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(_this1.date))).Ticks)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond))) < end); } else { #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" tmp = false; } #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" if (!(tmp)) { #line 127 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" break; } #line 128 "/opt/haxe/std/cs/_std/sys/net/Socket.hx" global::System.Threading.Thread.Sleep(((int)(5))); } } #line default }
protected static void __hx_ctor__Date(global::Date __hx_this, int year, int month, int day, int hour, int min, int sec) { unchecked { #line 38 "/opt/haxe/std/cs/_std/Date.hx" if ((day <= 0)) { #line 39 "/opt/haxe/std/cs/_std/Date.hx" day = 1; } #line 40 "/opt/haxe/std/cs/_std/Date.hx" if ((year <= 0)) { #line 41 "/opt/haxe/std/cs/_std/Date.hx" year = 1; } #line 42 "/opt/haxe/std/cs/_std/Date.hx" __hx_this.date = new global::System.DateTime(((int)(year)), ((int)((month + 1))), ((int)(day)), ((int)(hour)), ((int)(min)), ((int)(sec)), ((global::System.DateTimeKind)(global::System.DateTimeKind.Local))); __hx_this.dateUTC = __hx_this.date.ToUniversalTime(); } #line default }
public static global::Date fromString(string s) { unchecked { int _g = s.Length; switch (_g) { case 8: { global::Array <object> k = global::haxe.lang.StringExt.split(s, ":"); global::Date d = new global::Date(1, 1, 1, (global::Std.parseInt(global::haxe.lang.Runtime.toString(k[0]))).@value, (global::Std.parseInt(global::haxe.lang.Runtime.toString(k[1]))).@value, (global::Std.parseInt(global::haxe.lang.Runtime.toString(k[2]))).@value); return(d); } case 10: { global::Array <object> k1 = global::haxe.lang.StringExt.split(s, "-"); return(new global::Date((global::Std.parseInt(global::haxe.lang.Runtime.toString(k1[0]))).@value, ((global::Std.parseInt(global::haxe.lang.Runtime.toString(k1[1]))).@value - 1), (global::Std.parseInt(global::haxe.lang.Runtime.toString(k1[2]))).@value, 0, 0, 0)); } case 19: { global::Array <object> k2 = global::haxe.lang.StringExt.split(s, " "); global::Array <object> y = global::haxe.lang.StringExt.split(global::haxe.lang.Runtime.toString(k2[0]), "-"); global::Array <object> t = global::haxe.lang.StringExt.split(global::haxe.lang.Runtime.toString(k2[1]), ":"); return(new global::Date((global::Std.parseInt(global::haxe.lang.Runtime.toString(y[0]))).@value, ((global::Std.parseInt(global::haxe.lang.Runtime.toString(y[1]))).@value - 1), (global::Std.parseInt(global::haxe.lang.Runtime.toString(y[2]))).@value, (global::Std.parseInt(global::haxe.lang.Runtime.toString(t[0]))).@value, (global::Std.parseInt(global::haxe.lang.Runtime.toString(t[1]))).@value, (global::Std.parseInt(global::haxe.lang.Runtime.toString(t[2]))).@value)); } default: { throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat("Invalid date format : ", s)); } } } }
public void MergeFrom(TimePeriod other) { if (other == null) { return; } if (other.initialDate_ != null) { if (initialDate_ == null) { InitialDate = new global::Date(); } InitialDate.MergeFrom(other.InitialDate); } if (other.finalDate_ != null) { if (finalDate_ == null) { FinalDate = new global::Date(); } FinalDate.MergeFrom(other.FinalDate); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public virtual void write(object k, object v) { unchecked { #line 82 "/opt/haxe/std/haxe/format/JsonPrinter.hx" if ((this.replacer != null)) { #line 83 "/opt/haxe/std/haxe/format/JsonPrinter.hx" v = ((object)(this.replacer.__hx_invoke2_o(default(double), k, default(double), v))); } #line 84 "/opt/haxe/std/haxe/format/JsonPrinter.hx" { #line 84 "/opt/haxe/std/haxe/format/JsonPrinter.hx" global::ValueType _g = global::Type.@typeof(v); #line 84 "/opt/haxe/std/haxe/format/JsonPrinter.hx" switch (_g._hx_index) { case 0: { #line 136 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)("null"))); #line 136 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 1: { #line 90 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.toString(v))))); #line 90 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 2: { #line 92 "/opt/haxe/std/haxe/format/JsonPrinter.hx" double f = ((double)(global::haxe.lang.Runtime.toDouble(v))); #line 92 "/opt/haxe/std/haxe/format/JsonPrinter.hx" string v1 = (((!(global::System.Double.IsInfinity(((double)(f)))) && !(global::System.Double.IsNaN(((double)(f)))))) ? (global::Std.@string(v)) : ("null")); #line 92 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)(global::Std.@string(v1)))); #line 92 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 3: { #line 134 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.toString(v))))); #line 134 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 4: { #line 88 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.fieldsString(v, global::Reflect.fields(v)); #line 88 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 5: { #line 94 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)("\"<fun>\""))); #line 94 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 6: { #line 95 "/opt/haxe/std/haxe/format/JsonPrinter.hx" global::System.Type c = (_g as global::ValueType_TClass).c; if (global::haxe.lang.Runtime.refEq(c, typeof(string))) { #line 97 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.quote(global::haxe.lang.Runtime.toString(v)); } else if (global::haxe.lang.Runtime.refEq(c, typeof(global::Array <object>))) { #line 99 "/opt/haxe/std/haxe/format/JsonPrinter.hx" global::Array v2 = ((global::Array)(v)); this.buf.addChar(91); #line 102 "/opt/haxe/std/haxe/format/JsonPrinter.hx" int len = ((int)(global::haxe.lang.Runtime.getField_f(v2, "length", 520590566, true))); int last = (len - 1); #line 104 "/opt/haxe/std/haxe/format/JsonPrinter.hx" { #line 104 "/opt/haxe/std/haxe/format/JsonPrinter.hx" int _g1 = 0; #line 104 "/opt/haxe/std/haxe/format/JsonPrinter.hx" int _g2 = len; #line 104 "/opt/haxe/std/haxe/format/JsonPrinter.hx" while ((_g1 < _g2)) { #line 104 "/opt/haxe/std/haxe/format/JsonPrinter.hx" int i = _g1++; if ((i > 0)) { #line 106 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.addChar(44); } else { #line 108 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.nind++; } #line 109 "/opt/haxe/std/haxe/format/JsonPrinter.hx" if (this.pretty) { #line 109 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.addChar(10); } #line 110 "/opt/haxe/std/haxe/format/JsonPrinter.hx" if (this.pretty) { #line 110 "/opt/haxe/std/haxe/format/JsonPrinter.hx" string v3 = global::StringTools.lpad("", this.indent, (this.nind * this.indent.Length)); #line 110 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)(global::Std.@string(v3)))); } #line 111 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.write(i, v2[i]); if ((i == last)) { #line 113 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.nind--; if (this.pretty) { #line 114 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.addChar(10); } #line 115 "/opt/haxe/std/haxe/format/JsonPrinter.hx" if (this.pretty) { #line 115 "/opt/haxe/std/haxe/format/JsonPrinter.hx" string v4 = global::StringTools.lpad("", this.indent, (this.nind * this.indent.Length)); #line 115 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)(global::Std.@string(v4)))); } } } } #line 118 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.addChar(93); } else if (global::haxe.lang.Runtime.refEq(c, typeof(global::haxe.ds.StringMap <object>))) { #line 120 "/opt/haxe/std/haxe/format/JsonPrinter.hx" global::haxe.ds.StringMap v5 = ((global::haxe.ds.StringMap)(v)); object o = new global::haxe.lang.DynamicObject(new int[] {}, new object[] {}, new int[] {}, new double[] {}); #line 122 "/opt/haxe/std/haxe/format/JsonPrinter.hx" { #line 122 "/opt/haxe/std/haxe/format/JsonPrinter.hx" object k1 = ((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)(v5)))))))); #line 122 "/opt/haxe/std/haxe/format/JsonPrinter.hx" while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(k1, "hasNext", 407283053, null))) { #line 122 "/opt/haxe/std/haxe/format/JsonPrinter.hx" string k2 = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(k1, "next", 1224901875, null)); global::Reflect.setField(o, k2, ((object)(global::haxe.lang.Runtime.callField(v5, "get", 5144726, new object[] { k2 })))); } } #line 124 "/opt/haxe/std/haxe/format/JsonPrinter.hx" { #line 124 "/opt/haxe/std/haxe/format/JsonPrinter.hx" object v6 = ((object)(o)); #line 124 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.fieldsString(v6, global::Reflect.fields(v6)); } } else if (global::haxe.lang.Runtime.refEq(c, typeof(global::Date))) { #line 126 "/opt/haxe/std/haxe/format/JsonPrinter.hx" global::Date v7 = ((global::Date)(v)); this.quote(v7.toString()); } else { #line 129 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.classString(v); } #line 95 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 7: { #line 130 "/opt/haxe/std/haxe/format/JsonPrinter.hx" global::System.Type _g3 = (_g as global::ValueType_TEnum).e; #line 130 "/opt/haxe/std/haxe/format/JsonPrinter.hx" { #line 131 "/opt/haxe/std/haxe/format/JsonPrinter.hx" object i1 = global::Type.enumIndex(v); this.buf.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.toString(i1))))); } #line 130 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } case 8: { #line 86 "/opt/haxe/std/haxe/format/JsonPrinter.hx" this.buf.b.Append(((string)("\"???\""))); #line 86 "/opt/haxe/std/haxe/format/JsonPrinter.hx" break; } } } } #line default }
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))); } }
public static void __hx_ctor__Date(global::Date __hx_this, global::System.DateTime native) { __hx_this.date = native; }
public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch (tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Id = input.ReadInt32(); break; } case 18: { Name = input.ReadString(); break; } case 29: { Height = input.ReadFloat(); break; } case 37: { Weight = input.ReadFloat(); break; } case 42: { Avator = input.ReadBytes(); break; } case 50: { Email = input.ReadString(); break; } case 56: { EmailVerified = input.ReadBool(); break; } case 66: { phoneNumber_.AddEntriesFrom(input, _repeated_phoneNumber_codec); break; } case 88: { Gender = (global::My.Project.Gender)input.ReadEnum(); break; } case 98: { if (birthday_ == null) { Birthday = new global::Date(); } input.ReadMessage(Birthday); break; } case 106: { addresses_.AddEntriesFrom(input, _repeated_addresses_codec); break; } } } #endif }
public virtual void write(object k, object v) { unchecked { if ((this.replacer != null)) { v = ((object)(this.replacer.__hx_invoke2_o(default(double), k, default(double), v))); } { global::ValueType _g = global::Type.@typeof(v); switch (_g.index) { case 0: { this.buf.b.Append(((string)("null"))); break; } case 1: { this.buf.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.toString(v))))); break; } case 2: { string v1 = null; double f = ((double)(global::haxe.lang.Runtime.toDouble(v))); if ((!(global::System.Double.IsInfinity(((double)(f)))) && !(global::System.Double.IsNaN(((double)(f)))))) { v1 = global::haxe.lang.Runtime.toString(v); } else { v1 = "null"; } this.buf.b.Append(((string)(global::Std.@string(v1)))); break; } case 3: { this.buf.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.toString(v))))); break; } case 4: { this.fieldsString(v, global::Reflect.fields(v)); break; } case 5: { this.buf.b.Append(((string)("\"<fun>\""))); break; } case 6: { global::System.Type c = ((global::System.Type)(_g.@params[0])); if (global::haxe.lang.Runtime.refEq(c, typeof(string))) { this.quote(global::haxe.lang.Runtime.toString(v)); } else if (global::haxe.lang.Runtime.refEq(c, typeof(global::Array <object>))) { global::Array v2 = ((global::Array)(v)); this.buf.b.Append(((char)(91))); int len = ((int)(global::haxe.lang.Runtime.getField_f(v2, "length", 520590566, true))); int last = (len - 1); { int _g1 = 0; int _g2 = len; while ((_g1 < _g2)) { int i = _g1++; if ((i > 0)) { this.buf.b.Append(((char)(44))); } else { this.nind++; } if (this.pretty) { this.buf.b.Append(((char)(10))); } if (this.pretty) { string v3 = global::StringTools.lpad("", this.indent, (this.nind * this.indent.Length)); this.buf.b.Append(((string)(global::Std.@string(v3)))); } this.write(i, v2[i]); if ((i == last)) { this.nind--; if (this.pretty) { this.buf.b.Append(((char)(10))); } if (this.pretty) { string v4 = global::StringTools.lpad("", this.indent, (this.nind * this.indent.Length)); this.buf.b.Append(((string)(global::Std.@string(v4)))); } } } } this.buf.b.Append(((char)(93))); } else if (global::haxe.lang.Runtime.refEq(c, typeof(global::haxe.ds.StringMap <object>))) { global::haxe.ds.StringMap v5 = ((global::haxe.ds.StringMap)(v)); object o = new global::haxe.lang.DynamicObject(new int[] {}, new object[] {}, new int[] {}, new double[] {}); { object k1 = ((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)(v5)))))))); while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(k1, "hasNext", 407283053, null))) { string k2 = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(k1, "next", 1224901875, null)); global::Reflect.setField(o, k2, ((object)(global::haxe.lang.Runtime.callField(v5, "get", 5144726, new global::Array <object>(new object[] { k2 }))))); } } this.fieldsString(o, global::Reflect.fields(o)); } else if (global::haxe.lang.Runtime.refEq(c, typeof(global::Date))) { global::Date v6 = ((global::Date)(v)); this.quote(v6.toString()); } else { this.fieldsString(v, global::Reflect.fields(v)); } break; } case 7: { object i1 = global::Type.enumIndex(v); this.buf.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.toString(i1))))); break; } case 8: { this.buf.b.Append(((string)("\"???\""))); break; } } } } }
public static void main() { unchecked { global::Array <object> argv = global::Sys.args(); global::Array <object> input_path = new global::Array <object>(new object[] { "" }); global::Array <object> output_path = new global::Array <object>(new object[] { "" }); global::Array <int> force = new global::Array <int>(new int[] { 0 }); global::Array <int> quality = new global::Array <int>(new int[] { 11 }); global::Array <int> decompress = new global::Array <int>(new int[] { 0 }); if (!(global::Main.ParseArgv(argv.length, argv, input_path, output_path, force, quality, decompress))) { return; } if (!(global::sys.FileSystem.exists(global::haxe.lang.Runtime.toString(input_path[0])))) { global::System.Console.Write(((object)("Input Filename doesn\'t exists"))); return; } if ((global::sys.FileSystem.exists(global::haxe.lang.Runtime.toString(output_path[0])) && (force[0] == 0))) { global::System.Console.Write(((object)("Output Filename can\'t overwrite"))); return; } uint[] dictionary = global::Brotli.OpenInputBinary("dictionary.txt"); global::Date _this = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))); double clock_start = (((double)(((long)((((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(_this.date))).Ticks)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond))); global::sys.io.FileInput fin = global::Brotli.OpenInputFile(global::haxe.lang.Runtime.toString(input_path[0])); global::sys.io.FileOutput fout = global::Brotli.OpenOutputFile(global::haxe.lang.Runtime.toString(output_path[0]), force[0]); if ((decompress[0] > 0)) { global::decode.Dictionary.kBrotliDictionary = dictionary; global::Date _this1 = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))); long __temp_expr3 = (((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(_this1.date))).Ticks)) - ((long)(global::Date.epochTicks))); long __temp_expr4 = global::System.TimeSpan.TicksPerMillisecond; if ((global::decode.Decode.BrotliDecompress(global::decode.Streams.BrotliFileInput(fin), global::decode.Streams.BrotliFileOutput(fout)) <= 0)) { global::System.Console.Write(((object)("Error while decoding"))); return; } } else { global::encode.Dictionary.kBrotliDictionary = dictionary; uint[] DictionaryHash = global::Brotli.OpenInputBinary("DictionaryHash.txt"); uint[] DictionaryWords = global::Brotli.OpenInputBinary("DictionaryWords.txt"); uint[] DictionaryBuckets = global::Brotli.OpenInputBinary("DictionaryBuckets.txt"); global::Array <uint> kStaticDictionaryHash = global::encode.Dictionary_hash.kStaticDictionaryHash; global::Array <uint> kStaticDictionaryBuckets = global::encode.Static_dict_lut.kStaticDictionaryBuckets; { int _g = 0; while ((_g < 32768)) { int i = _g++; kStaticDictionaryHash.push(((uint)((((uint)((((uint)(((uint[])(DictionaryHash))[((i * 2) + 1)])) << 8))) | ((uint)(((uint[])(DictionaryHash))[(i * 2)])))))); kStaticDictionaryBuckets.push(((uint)((((uint)((((uint)((((uint)(((uint[])(DictionaryBuckets))[((i * 3) + 2)])) << 16))) | ((uint)((((uint)(((uint[])(DictionaryBuckets))[((i * 3) + 1)])) << 8)))))) | ((uint)(((uint[])(DictionaryBuckets))[(i * 3)])))))); } } global::Array <object> kStaticDictionaryWords = global::encode.Static_dict_lut.kStaticDictionaryWords; { int _g1 = 0; while ((_g1 < 31704)) { int i1 = _g1++; kStaticDictionaryWords.push(new global::encode.static_dict_lut.DictWord(((uint)(((uint)((((uint)(((uint)(((uint[])(DictionaryWords))[((i1 * 3) + 1)])))) >> 3))))), ((uint)(((uint[])(DictionaryWords))[((i1 * 3) + 2)])), ((uint)((((uint)(((((uint)((((uint)(((uint[])(DictionaryWords))[((i1 * 3) + 1)])) & 7)))) << 8))) | ((uint)(((uint[])(DictionaryWords))[(i1 * 3)]))))))); } } global::encode.encode.BrotliParams @params = new global::encode.encode.BrotliParams(); @params.quality = quality[0]; global::Date _this2 = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))); long __temp_expr1 = (((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(_this2.date))).Ticks)) - ((long)(global::Date.epochTicks))); long __temp_expr2 = global::System.TimeSpan.TicksPerMillisecond; if (!(global::encode.Encode.BrotliCompress(@params, new global::encode.streams.BrotliIn(fin, 65536), new global::encode.streams.BrotliOut(((global::sys.io.FileOutput)(fout)))))) { global::System.Console.Write(((object)("Error while encoding"))); return; } } global::Date _this3 = new global::Date(((global::System.DateTime)(global::System.DateTime.Now))); double duration = ((((((double)(((long)((((long)(global::System.TimeZone.CurrentTimeZone.ToUniversalTime(((global::System.DateTime)(_this3.date))).Ticks)) - ((long)(global::Date.epochTicks))))))) / ((double)(global::System.TimeSpan.TicksPerMillisecond))) - clock_start)) / 1000); if ((duration < 1e-9)) { duration = 1e-9; } if ((decompress[0] > 0)) { fout.tell(); } else { fin.tell(); } return; } }
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))); } } } }
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch (tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { Id = input.ReadInt32(); break; } case 18: { Name = input.ReadString(); break; } case 29: { Height = input.ReadFloat(); break; } case 37: { Weight = input.ReadFloat(); break; } case 42: { Avator = input.ReadBytes(); break; } case 50: { Email = input.ReadString(); break; } case 56: { EmailVerified = input.ReadBool(); break; } case 66: { phoneNumber_.AddEntriesFrom(ref input, _repeated_phoneNumber_codec); break; } case 88: { Gender = (global::My.Project.Gender)input.ReadEnum(); break; } case 98: { if (birthday_ == null) { Birthday = new global::Date(); } input.ReadMessage(Birthday); break; } case 106: { addresses_.AddEntriesFrom(ref input, _repeated_addresses_codec); break; } } } }