Source

ocamlspot / treeset.mli

(***********************************************************************)
(*                                                                     *)
(*                            OCamlSpotter                             *)
(*                                                                     *)
(*                             Jun FURUSE                              *)
(*                                                                     *)
(*   Copyright 2008-2012 Jun Furuse. All rights reserved.              *)
(*   This file is distributed under the terms of the GNU Library       *)
(*   General Public License, with the special exception on linking     *)
(*   described in file LICENSE.                                        *)
(*                                                                     *)
(***********************************************************************)

module type OrderedType = sig
  type t
  val compare : t -> t 
    -> [ `Included | `Includes | `Left | `Overwrap | `Right | `Same ]
  val split : t -> by:t -> (t * t) option
end

module Make (Ord : OrderedType) : sig
  type elem = Ord.t
  type 'a node = Node of elem * 'a

  module rec Node : sig 
    type t = NodeSet.t node 
    val compare : t -> t -> int 
  end and NodeSet : Xset.S with type elt = Node.t 

  include Xset.S with type elt = Node.t and type t = NodeSet.t

  val add_elem : elem -> t -> t

  val find_path_contains : elem -> t -> (elem * t) list
    (** Returns the path which contains [elem].
        The result is the elems which contains [elem].
        Deeper (smaller) elem comes first. *)

  val iter_elem : (parent:elem option -> elem -> 'a) -> t -> unit
end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.