e3800cf3ce1e0d1ca7572cefb090717efbe73e55
[mclu.git] / utils.mli
1 (* mclu: Mini Cloud
2  * Copyright (C) 2014-2015 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *)
18
19 (** Miscellaneous utility functions. *)
20
21 val (//) : string -> string -> string
22 val quote : string -> string
23
24 val ( +^ ) : int64 -> int64 -> int64
25 val ( -^ ) : int64 -> int64 -> int64
26 val ( *^ ) : int64 -> int64 -> int64
27 val ( /^ ) : int64 -> int64 -> int64
28 val ( &^ ) : int64 -> int64 -> int64
29 val ( ~^ ) : int64 -> int64
30 (** Various int64 operators. *)
31
32 val human_size : int64 -> string
33 (** Turn a bytes count into a human-readable string (eg. [4.0G]). *)
34
35 val bytes_of_human_size : string -> int64
36
37 val string_of_dom_state : Libvirt.Domain.state -> string
38
39 val regexp_of_glob : string -> string
40 (** Convert glob to regular expression. *)
41
42 val string_random8 : unit -> string
43
44 val name_parse : string -> string option * string
45 (** Parse a guest name of either [name] or [node:name] into the parts. *)