operations on ldap dns

exception Invalid_dn of int * string

raised when something goes wrong with conversion to or from a string. The integer argument is the charachter which the lexer was looking at then the failure ocurred. In the case of to_string the integer argument will always be zero.

val of_string : string -> Ldap_types.dn

Given a string representation of a dn, return a structured representation. unescapes any escape sequences present.

val to_string : Ldap_types.dn -> string

Given a structural representation of a dn, return a string representation. Performs all the necessary escaping to correctly represent any structured representation.

val escape_value : string -> string

Escape a string which you intend to be part of a VALUE in the dn. Do not use on the whole dn, just an attribute value. It is NOT necessary to use this if you intend to call to_string on your dn. It will be done for you as part of the conversion process. This function is exposed for the case where you find it easier to manipulate the dn via a regular expression, or other string based means, and you find it necessary to escape values.

val canonical_dn : string -> string

returns the canonical dn. A simple string compare can tell you accurately whether two canonical dns are equal or not.