Exemplo n.º 1
0
        public static string[] ToTextArray(Obj obj)
        {
            Obj[] elts = obj.GetObjArray();
            int   len  = elts.Length;

            string[] strs = new string[len];
            for (int i = 0; i < len; i++)
            {
                strs[i] = ExportAsText(elts[i]);
            }
            return(strs);
        }
Exemplo n.º 2
0
        public static string[] ToStringArray(Obj obj)
        {
            Obj[] elts = obj.GetObjArray();
            int   len  = elts.Length;

            string[] strs = new string[len];
            for (int i = 0; i < len; i++)
            {
                strs[i] = elts[i].GetString();
            }
            return(strs);
        }
Exemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////////

        public static bool[] ToBoolArray(Obj obj)
        {
            if (obj.IsSeq())
            {
                bool[] array = obj.GetBoolArray();
                return(Array.Take(array, array.Length));
            }

            Obj[] elts = obj.GetObjArray();
            int   len  = elts.Length;

            bool[] bools = new bool[len];
            for (int i = 0; i < len; i++)
            {
                bools[i] = elts[i].GetBool();
            }
            return(bools);
        }
Exemplo n.º 4
0
        public static double[] ToDoubleArray(Obj obj)
        {
            if (obj.IsSeq())
            {
                double[] array = obj.GetDoubleArray();
                return(Array.Take(array, array.Length));
            }

            Obj[] elts = obj.GetObjArray();
            int   len  = elts.Length;

            double[] doubles = new double[len];
            for (int i = 0; i < len; i++)
            {
                doubles[i] = elts[i].GetDouble();
            }
            return(doubles);
        }
Exemplo n.º 5
0
        public static long[] ToLongArray(Obj obj)
        {
            if (obj.IsSeq())
            {
                long[] array = obj.GetLongArray();
                return(Array.Take(array, array.Length));
            }

            Obj[] elts = obj.GetObjArray();
            int   len  = elts.Length;

            long[] longs = new long[len];
            for (int i = 0; i < len; i++)
            {
                longs[i] = elts[i].GetLong();
            }
            return(longs);
        }