class Multipart::Parser
- Multipart::Parser
- Reference
- Object
Defined in:
multipart/parser.crConstructors
Instance Method Summary
- #boundary : String
- #boundary_chars : Hash(Char, Bool)
-
#callback(event, buffer = nil, start = nil, the_end = nil)
Issues a callback.
-
#data_callback(data_type, buffer, the_end, options = {} of String => String)
Issues a data callback, The only valid options is :clear, which, if true, will reset the appropriate mark to 0, If not specified, the mark will be removed.
- #init_with_boundary(boundary)
-
#on(event, &callback)
Registers a callback to be called when the given event occurs.
-
#write(buffer)
Writes data to the parser.
Constructor Detail
Instance Method Detail
Issues a data callback, The only valid options is :clear, which, if true, will reset the appropriate mark to 0, If not specified, the mark will be removed.
Registers a callback to be called when the given event occurs. Each callback is expected to take three parameters: buffer, start_index, and end_index. All of these parameters may be null, depending on the callback. Valid callbacks are: :end :header_field :header_value :header_end :headers_end :part_begin :part_data :part_end
Writes data to the parser. Returns the number of bytes parsed. In practise, this means that if the return value is less than the buffer size, a parse error occured.