Typical use is to use the Reader factory function to instantiate an object of an appropriate derived class based on the file extension of the given path:

auto reader <- Reader(path);


A read of a single buffer can then be performed with:

reader.read(buffer);


Finally, close the file:

reader.close();


Name Description

### Member Functions

Name Description
open Open a file.
close Close the file.

### Member Fibers

Name Description
walk Read the contents of the file sequentially.

### Factory Function Details

Create a reader for a file.

• path: Path of the file.

The file extension of path is used to determine the precise type of the returned object. Supported file extension are .json and .yml.

### Member Function Details

#### close

abstract function close()

Close the file.

#### open

abstract function open(path:String)

Open a file.

• path: Path of the file.

Read the entire contents of the file.

• buffer: Buffer into which to read.

### Member Fiber Details

#### walk

abstract fiber walk() -> Buffer!

Read the contents of the file sequentially.

Yields: A buffer for each element of the top level sequence.

For a file that consists of a sequence at the top level, yields each element of that sequence one at a time, to avoid reading the whole file into memory at once.