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); }
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); }
//////////////////////////////////////////////////////////////////////////// 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); }
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); }
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); }