Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type 'flags t = private {
offset : int;
Starting at offset
'th unicode sequence
operation : operation;
text_len : int;
flags : 'flags list;
A list of backend defined flags
.
}
A flags Patch.t
represents the replacement of a piece of text by another, possibly annotated by values of type flags
.
utf8_length str
is the number of unicode sequences in str
.
str
is assumed to be a valid utf-8 string, result is undefined otherwise.
utf8_offset str ?offset index
returns the offset as a number of bytes of the index
th unicode sequences in str
.
If offset
is provided, search starts from this byte. Otherwise it defaults to 0. If index
is 0, 0 is returned. If index
is one more than the number of sequences in str
, String.length str
is returned. If index
is even more than that, exception Not_found
is thrown.
str
is assumed to be a valid utf-8 string, result is undefined otherwise.
Produces a patch, ensuring that new_len = utf8_length text
. TODO: validate utf-8 string.
val removed : _ t -> int
val inserted : _ t -> int
val inserted_text : _ t -> string