package biocaml
Install
Dune Dependency
Authors
Maintainers
Sources
md5=4cf944bcae5d36bf47b67f6bcb2455d7
sha512=0262b5768aefd7c080f664c46c88876fce9a658cc6a87358a77b7112c49ae3042e7ab542e76be5738fbaeda853149b308b48d4897960b5c7ae3b4da71d978bd8
doc/biocaml.ez/Biocaml_ez/Lines/Buffer/index.html
Module Lines.Buffer
Buffer used to parse strings into lines.
val make : ?filename:string -> unit -> t
Make a new empty buffer. The optional filename
is used only for error reporting; it should be set to the name of the file, if any, from which you will feed the buffer.
val feed_string : t -> string -> unit
Feed the parser with an arbitrary string buffer.
val queued_lines : t -> int
Get the number of lines ready-to-use in the buffer/queue.
val is_empty : t -> bool
Tell if the parser's buffers are empty or not. For instance, when there is no more content to feed and next_line
returns None
, is_empty p = true
means that the content did not end with a complete line.
Get the next line, but throw No_next_line
if there is no line to return.
val current_position : t -> Biocaml_unix.Pos.t
Get the current position in the stream.
Return any remaining lines and the unfinished string, without removing them from the buffer.
val empty : t -> unit
Empty the buffer. Subsequent call to contents
will return ([], None)
.