Esempio n. 1
0
 public static char Chr(int code)
 {
     return(Encd.GetChars(new byte[] { (byte)code })[0]);
 }
Esempio n. 2
0
        object r()
        {
            int i = 0, n, t = (sbyte)b[j++]; if (t < 0)

            {
                switch (t)
                {
                case -1: return(rb());

                case -2: return(rg());

                case -4: return(b[j++]);

                case -5: return(rh());

                case -6: return(ri());

                case -7: return(rj());

                case -8: return(re());

                case -9: return(rf());

                case -10: return(rc());

                case -11: return(rs());

                case -12: return(rp());

                case -13: return(rm());

                case -14: return(rd());

                case -15: return(rz());

                case -16: return(rn());

                case -17: return(ru());

                case -18: return(rv());

                case -19: return(rt());
                }
            }
            if (t > 99)
            {
                if (t == 101 && b[j++] == 0)
                {
                    return(null);
                }
                throw new KException("func");
            }
            if (t == 99)
            {
                return(new Dict(r(), r()));
            }
            j++; if (t == 98)
            {
                return(new Flip((Dict)r()));
            }
            n = ri(); switch (t)
            {
            case 0: object[] L = new object[n]; for (; i < n; i++)
                {
                    L[i] = r();
                }
                return(L);

            case 1: bool[] B = new bool[n]; for (; i < n; i++)
                {
                    B[i] = rb();
                }
                return(B);

            case 2: { Guid[] G = new Guid[n]; for (; i < n; i++)
                      {
                          G[i] = rg();
                      }
                      return(G); }

            case 4: { byte[] G = new byte[n]; for (; i < n; i++)
                      {
                          G[i] = b[j++];
                      }
                      return(G); }

            case 5: short[] H = new short[n]; for (; i < n; i++)
                {
                    H[i] = rh();
                }
                return(H);

            case 6: int[] I = new int[n]; for (; i < n; i++)
                {
                    I[i] = ri();
                }
                return(I);

            case 7: long[] J = new long[n]; for (; i < n; i++)
                {
                    J[i] = rj();
                }
                return(J);

            case 8: float[] E = new float[n]; for (; i < n; i++)
                {
                    E[i] = re();
                }
                return(E);

            case 9: double[] F = new double[n]; for (; i < n; i++)
                {
                    F[i] = rf();
                }
                return(F);

            case 10: char[] C = e.GetChars(b, j, n); j += n; return(C);

            case 11: string[] S = new string[n]; for (; i < n; i++)
                {
                    S[i] = rs();
                }
                return(S);

            case 12: DateTime[] P = new DateTime[n]; for (; i < n; i++)
                {
                    P[i] = rp();
                }
                return(P);

            case 13: Month[] M = new Month[n]; for (; i < n; i++)
                {
                    M[i] = rm();
                }
                return(M);

            case 14: Date[] D = new Date[n]; for (; i < n; i++)
                {
                    D[i] = rd();
                }
                return(D);

            case 15: DateTime[] Z = new DateTime[n]; for (; i < n; i++)
                {
                    Z[i] = rz();
                }
                return(Z);

            case 16: KTimespan[] N = new KTimespan[n]; for (; i < n; i++)
                {
                    N[i] = rn();
                }
                return(N);

            case 17: Minute[] U = new Minute[n]; for (; i < n; i++)
                {
                    U[i] = ru();
                }
                return(U);

            case 18: Second[] V = new Second[n]; for (; i < n; i++)
                {
                    V[i] = rv();
                }
                return(V);

            case 19: TimeSpan[] T = new TimeSpan[n]; for (; i < n; i++)
                {
                    T[i] = rt();
                }
                return(T);
            }
            return(null);
        }
Esempio n. 3
0
 public override char[] GetChars(byte[] bytes)
 {
     return(enc.GetChars(bytes));
 }