Module Delimited__.Shared
include module type of Delimited_kernel.Shared
type ('a, 'b) reader= ?strip:bool -> ?skip_lines:int -> ?on_parse_error:[ `Raise | `Handle of string Core_kernel.Queue.t -> exn -> [ `Continue | `Finish ] ] -> header:'a -> 'bIf strip is true (default is false) then spaces will be stripped from the beginning and end of fields.
If
skip_linesis given then that number of lines will be read and discarded from the top of the file or Reader.t given.If
on_parse_erroris `Raise any lines that fail to parse will raise an exception. If `Handle is given the offending line will be passed to the function given, which may then indicate that processing should continue or finish.
val buffer_size : intRecommendation based on the largest reads and writes observed off a disk or socket.
val strip_buffer : Core_kernel.Buffer.t -> stringval make_emit_field : strip:bool -> string Core_kernel.Queue.t -> Core_kernel.Buffer.t -> (unit -> unit) Core_kernel.Staged.tmake_emit_field ~strip row bufferreturns a closure which enqueuesbufferintorow, stripping leading and trailing whitespace ifstrip = true.
val make_emit_row : string Core_kernel.Queue.t -> Delimited_kernel__.Row.t Core_kernel.Queue.t -> Delimited_kernel__.Header.t -> lineno:int Core_kernel.ref -> [ `on_eof of unit -> unit ] * (unit -> unit)make_emit_row row rows header ~linenoreturns(`on_eof on_eof, emit_row). After zero or more calls toemit_rowand a call toon_eof,rowswill contain the parsed file.Note that
rowsmay have fewer elements than the number of calls toemit_row, ifheaderspecifies that the firstrowis a header line.
val drop_lines : Async.Reader.t -> int -> unit Async.Deferred.tdrop_lines r nreads and discards up to and including thenth newline fromr.