Packages

A plug for hierarchical data submit with arbitrary number of files embedded in.

Current section

Files

Jump to
saxon lib parsers string.ex
Raw

lib/parsers/string.ex

defmodule Saxon.Parsers.STRING do
defstruct buffer: [], attributes: %{}
def new(attributes \\ %{}), do: %__MODULE__{attributes: attributes}
def update(%__MODULE__{buffer: buffer} = parser, chunk) do
%{parser | buffer: [buffer, chunk]}
end
def parse(%__MODULE__{buffer: buffer, attributes: attributes}) do
result = buffer |> IO.iodata_to_binary()
{:ok, result, attributes}
end
end