Struct extra::fileinput::FileInput

pub struct FileInput {
    fi: @mut FileInput_,
}

Methods

impl FileInput

fn from_vec(files: ~[std::option::Option]) -> FileInput

Create a FileInput object from a vec of files. An empty vec means lines are read from stdin (use from_vec_raw to stop this behaviour). Any occurrence of None represents stdin.

fn from_vec_raw(files: ~[std::option::Option]) -> FileInput

Identical to from_vec, but an empty files vec stays empty. (None is stdin.)

fn from_args() -> FileInput

Create a FileInput object from the command line arguments. "-" represents stdin.

fn next_file(&self) -> bool

Skip to the next file in the queue. Can fail when opening a file.

Returns false if there is no more files, and true when it successfully opens the next file.

fn each_line_state(&self, f: &fn(&str, FileInputState) -> bool) -> bool

Apply f to each line successively, along with some state (line numbers and file names, see documentation for FileInputState). Otherwise identical to lines_each.

fn state(&self) -> FileInputState

Retrieve the current FileInputState information.

Trait Implementations

impl std::io::Reader for FileInput

fn read_byte(&self) -> int

fn read(&self, buf: &mut [u8], len: uint) -> uint

fn eof(&self) -> bool

fn seek(&self, offset: int, whence: std::io::SeekStyle)

fn tell(&self) -> uint