From ce38fa913c3b450f1177a2d8e431dbbb8e31af66 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Wed, 2 Jul 2025 20:03:15 +0200 Subject: docs(jid): document of_string function --- lib/jid.ml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/jid.ml b/lib/jid.ml index bbcd2a6..3564c5d 100644 --- a/lib/jid.ml +++ b/lib/jid.ml @@ -30,6 +30,17 @@ let uchars_of_string s : uchars = loop ((u, i) :: acc) (i + k) in loop [] 0 +(** Convert a [string] to a [Jid.t]. + + This function traverses the JID until an '/' char (or the end of the string) occurs. + + Anything before is the "bare" JID, and anything eventually after is the resource. + + Then, the function goes backward until an '@' char (or the start of the string) + occurs. + + Anything after is the domain, and anything eventually before is the localpart + (username). *) let of_string (jid : string) : t = let open List in let open String in -- cgit v1.2.3