camlspotter avatar camlspotter committed fb7d2a8

added char stream

Comments (0)

Files changed (2)

+module type S = sig
+  include Stream_intf.S with type Elem.t = char
+                        and  type Pos.t = Position.File.t
+                        and  type Attr.t = Sbuffer.buf
+  include Sbuffer.X with type t := t
+end
+
+module Base = struct
+
+  module Elem = Elem.Char     (* Stream elements *)
+  module Pos = Position.File  (* Stream positions *)
+
+  module Attr = struct
+    (* Stream attributes *)
+    type t = Sbuffer.buf (* Stream elements carry internal buffers *)
+    let position attr = Sbuffer.position_of_buf attr (* How to obtain the position from attr *)
+  end
+
+end
+
+module Str = Stream.Make(Base)
+include Str
+
+(* Extend Str with buffering *)
+include Sbuffer.Extend(struct
+  include Str
+  let create_attr buf = buf (* How to create an attribute from a buffer *)
+  let buf st = attr st (* How to obtain the buffer of a stream *)
+end)
+module type S = sig
+  include Stream_intf.S with type Elem.t = char
+                        and  type Pos.t = Position.File.t
+                        and  type Attr.t = Sbuffer.buf
+  include Sbuffer.X with type t := t
+end
+
+include S
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.