Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 4 of 4) sorted by relevance

/NovaShell/src/shell/
H A Dprinter.rs18 pub buf: Rc<RefCell<Vec<u8>>>, field
31 buf: Rc::clone(bytes), in new()
38 self.buf = Rc::new(RefCell::new(Vec::new())); in init_before_readline()
52 let len_to_end = self.buf.deref().borrow().len() - self.cursor; in insert()
55 let mut buf = self.buf.deref().borrow_mut(); in insert() localVariable
56 buf.splice(self.cursor..self.cursor, bytes.iter().cloned()); in insert()
61 String::from_utf8(buf[self.cursor..].to_vec()).unwrap() in insert()
80 let buf_len = self.buf.deref().borrow().len(); in delete()
85 self.buf.deref().borrow_mut().drain(cursor..cursor + len); in delete()
90 String::from_utf8(self.buf.deref().borrow()[self.cursor..].to_vec()).unwrap() in delete()
[all …]
H A Dmod.rs91 let command_bytes = self.printer.buf.borrow().clone(); in exec()
178 let mut buf: [u8; 1] = [0]; in read_char() localVariable
180 if std::io::stdin().read(&mut buf).is_ok() { in read_char()
181 return buf[0]; in read_char()
223 if self.printer.cursor < self.printer.buf.borrow().len() { in handle_funckey()
241 self.history_commands.push(Rc::clone(&self.printer.buf)); in readline()
262 let mut buf = self.printer.buf.deref().borrow().clone(); in readline() localVariable
263 buf.truncate(self.printer.cursor); in readline()
264 let str = String::from_utf8(buf.clone()).unwrap(); in readline()
265 if buf.len() == 0 || buf.iter().all(|byte| *byte == b' ') { in readline()
[all …]
/NovaShell/src/
H A Denv.rs35 let mut buf: Vec<u8> = Vec::new(); in read_env() localVariable
36 file.read_to_end(&mut buf).unwrap(); in read_env()
38 for str in String::from_utf8(buf).unwrap().split('\n') { in read_env()
/NovaShell/src/shell/command/
H A Dmod.rs186 let mut buf: Vec<u8> = Vec::new(); in shell_cmd_free() localVariable
187 info_file.read_to_end(&mut buf).unwrap(); in shell_cmd_free()
188 let str = String::from_utf8(buf).unwrap(); in shell_cmd_free()