Module Brr.Range

Range objects.

Comparison constants

type compare_how

Constants for the first argument of compare_boundary_points.

val end_to_end : compare_how

Range.END_TO_END.

val end_to_start : compare_how

Range.END_TO_START.

val start_to_end : compare_how

Range.START_TO_END.

val start_to_start : compare_how

Range.START_TO_START.

Ranges

type t

The type for Range objects.

val create : unit -> t

create () is a new range object.

val clone_range : t -> t

clone_range r clones r.

val collapse_to_start : t -> unit

collapse_to_start r collapses r to its start.

val collapse_to_end : t -> unit

collapse_to_end r collapses r to its end.

val compare_boundary_points : t -> compare_how -> t -> int

compare_boundary_points r how r' compares r to r'.

val compare_point : t -> El.t -> int -> int

compare_point r el offset compare r to el.

val delete_contents : t -> unit

delete_contents r deletes the content in range r.

val insert_node : t -> El.t -> unit

insert_node r el insert el at the start of r.

val intersects_node : t -> El.t -> bool

intersects_node r e is true if el intersects r.

val is_point_in_range : t -> El.t -> int -> bool

is_point_in_range r el offset is true if the point is in the range of r.

val select_node : t -> El.t -> unit

select_node r el sets r to conatin el.

val select_node_contents : t -> El.t -> unit

select_node_contents r el sets r to the contents of el.

val set_end : t -> El.t -> int -> unit

set_end r el offset sets the end of r to el.

val set_end_after : t -> El.t -> unit

set_end_after r el sets the end of r after the end of el.

val set_end_before : t -> El.t -> unit

set_end_before r sets the end of r before the end of el.

val set_start : t -> El.t -> int -> unit

set_start r el offset sets the start of r to el.

val set_start_after : t -> El.t -> unit

set_start_after r el sets the start of r after el.

val set_start_before : t -> El.t -> unit

set_start_before r el sets the start of r before el.

val surround_contents : t -> El.t -> unit

surround_contents r el surrounds the content of r by el.

val to_string : t -> Jstr.t

to_string r converts r to a string.

Properties

val collapsed : t -> bool

collapsed r indicates if r is collapsed.

val common_ancestor_container : t -> El.t

common_ancestor_container r is the common ancestor container of r

val end_container : t -> El.t

end_container r is the end container of r.

val end_offset : t -> int

end_offset r is the end offset of r.

val start_container : t -> El.t

end_container r is the start container of r.

val start_offset : t -> int

end_offset r is the start offset of r.