OCaml HTML5 parser/serialiser based on Python's JustHTML
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 81c4816404ceafd6d88e08303e3870f364dc0a32 80 lines 1.6 kB view raw
1(** Message collector for accumulating validation messages. *) 2 3(** The type of a message collector. *) 4type t 5 6(** {1 Creation} *) 7 8(** Create a new empty message collector. *) 9val create : unit -> t 10 11(** {1 Adding Messages} *) 12 13(** Add a message to the collector. *) 14val add : t -> Message.t -> unit 15 16(** Add an error message to the collector. *) 17val add_error : 18 t -> 19 message:string -> 20 ?code:string -> 21 ?location:Message.location -> 22 ?element:string -> 23 ?attribute:string -> 24 ?extract:string -> 25 unit -> 26 unit 27 28(** Add a warning message to the collector. *) 29val add_warning : 30 t -> 31 message:string -> 32 ?code:string -> 33 ?location:Message.location -> 34 ?element:string -> 35 ?attribute:string -> 36 ?extract:string -> 37 unit -> 38 unit 39 40(** Add an info message to the collector. *) 41val add_info : 42 t -> 43 message:string -> 44 ?code:string -> 45 ?location:Message.location -> 46 ?element:string -> 47 ?attribute:string -> 48 ?extract:string -> 49 unit -> 50 unit 51 52(** {1 Retrieving Messages} *) 53 54(** Get all messages in the order they were added. *) 55val messages : t -> Message.t list 56 57(** Get only error messages. *) 58val errors : t -> Message.t list 59 60(** Get only warning messages. *) 61val warnings : t -> Message.t list 62 63(** Get only info messages. *) 64val infos : t -> Message.t list 65 66(** {1 Status Queries} *) 67 68(** Check if the collector contains any error messages. *) 69val has_errors : t -> bool 70 71(** Get the total number of messages. *) 72val count : t -> int 73 74(** Get the number of error messages. *) 75val error_count : t -> int 76 77(** {1 Modification} *) 78 79(** Clear all messages from the collector. *) 80val clear : t -> unit