module OBus_string: sig .. end
Restriction on strings used with D-Bus
There are a lot a various restrictions for strings used in D-Bus.
Obus only verify strings when a message is sent or received
type error = {
|
typ : string; |
|
str : string; |
|
ofs : int; |
|
msg : string; |
}
val error_message : error -> string
error_message error returns a human-readabe error message
Error projections
val typ : error -> string
val str : error -> string
val ofs : error -> int
val msg : error -> string
Validators
type validator = string -> error option
Function which test if a string is correct.
- if it is, returns
None
- if not, returns
Some(ofs, msg)
exception Invalid_string of error
val assert_validate : validator -> string -> unit
Common strings
type t = string
Type for common strings, restrictions are:
- a string must be encoded in valid UTF-8
- a string must not contains the null byte
val validate : validator
Validatition function for commong strings