Expand description
Text operations on a selection: sorting and de-duplicating lines, changing case, trimming,
converting indentation, and re-formatting JSON. They work on decoded text and keep the
text’s own line breaks; the caller applies the result as one undoable edit, or, for a
document of any size, text_op_to streams it to a file.
Structs§
- Json
Formatter json_formata piece at a time: what it has seen is carried from one piece to the next.
Enums§
Constants§
- WINDOW
- Bytes decoded, changed and written at a time (whole lines).
Functions§
- apply
- codec_
apply - A decoding or encoding of
text: the bytes it gives (decoded bytes need not be text). - json_
format - Re-formats JSON token by token: key order, numbers and string escapes stay exactly as
written. Several top-level values (JSON Lines) stay on separate lines. With
indentthe output is indented, otherwise all insignificant whitespace is removed. - text_
op_ to - Writes
bufwithopapplied torange(the rest as it is) toout, whole lines at a time, for documents of any size. Returns the bytes written, orNonewhen cancelled.