Пример #1
0
        public static Value lib_fileiocommon_directoryList(VmContext vm, Value[] args)
        {
            Value         diskhost    = args[0];
            string        path        = (string)args[1].internalValue;
            bool          useFullPath = (bool)args[2].internalValue;
            ListImpl      outputList  = (ListImpl)args[3].internalValue;
            List <string> stringList1 = new List <string>();
            int           sc          = FileIOCommonHelper.GetDirectoryList(path, useFullPath, stringList1);

            if ((sc == 0))
            {
                int i = 0;
                while ((i < stringList1.Count))
                {
                    Interpreter.Vm.CrayonWrapper.addToList(outputList, Interpreter.Vm.CrayonWrapper.buildString(vm.globals, stringList1[i]));
                    i += 1;
                }
            }
            return(Interpreter.Vm.CrayonWrapper.buildInteger(vm.globals, sc));
        }