search for: json_string_of_bool

Displaying 6 results from an estimated 6 matches for "json_string_of_bool".

2014 Jan 16
0
[PATCH 3/3] builder: add a JSON output for --list
...list_entries_short index = List.iter ( @@ -78,3 +79,62 @@ and list_entries_long ~sources index = printf "\n" ) ) index + +and list_entries_json ~sources index = + let trailing_comma index size = + if index = size - 1 then "" else "," in + let json_string_of_bool b = + if b then "true" else "false" in + let json_string_escape str = + let res = ref "" in + for i = 0 to String.length str - 1 do + res := !res ^ (match str.[i] with + | '"' -> "\\\"" + | '\\' ->...
2014 Oct 10
0
[PATCH 3/3] builder: use the JSON module
...1679..2727c9f 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -97,92 +97,64 @@ and list_entries_long ~sources index = ) index and list_entries_json ~sources index = - let trailing_comma index size = - if index = size - 1 then "" else "," in - let json_string_of_bool b = - if b then "true" else "false" in - let json_string_escape str = - let res = ref "" in - for i = 0 to String.length str - 1 do - res := !res ^ (match str.[i] with - | '"' -> "\\\"" - | '\\' ->...
2014 May 26
2
[PATCH] builder: support aliases for images (RHBZ#1098718).
...dex = printf " \"size\": %Ld,\n" size; json_optional_printf_int64 "compressed-size" compressed_size; print_notes notes; + json_optional_printf_stringlist "aliases" aliases; printf " \"hidden\": %s\n" (json_string_of_bool hidden); printf " }%s\n" (trailing_comma i (List.length index)) ) index; diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod index 5c531de..a70767f 100644 --- a/builder/virt-builder.pod +++ b/builder/virt-builder.pod @@ -1288,6 +1288,14 @@ Using the hidden flag pre...
2014 Jan 16
5
[PATCH 0/3] Add JSON output for virt-builder
Hi, This small patch serie adds a JSON output for virt-builder. This way it is possible to parse the list of available templates, with no need to parse the unstructured and possibly changing short and long outputs of virt-builder. Pino Toscano (3): builder: small refactor of the list output builder: add --list-format builder: add a JSON output for --list builder/builder.ml
2014 Oct 10
4
[PATCH 1/3] Move JSON to mllib
Move the simple OCaml JSON writer to mllib, so that can be enhanced and used also outside v2v. --- mllib/JSON.ml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mllib/JSON.mli | 26 ++++++++++++++++++++++++++ mllib/Makefile.am | 5 ++++- po/POTFILES-ml | 2 +- v2v/JSON.ml | 53 ----------------------------------------------------- v2v/JSON.mli | 26
2014 Jan 22
2
[PATCH] builder: read all the available notes from the index
...intable_name; printf " \"size\": %Ld,\n" size; json_optional_printf_int64 "compressed-size" compressed_size; - json_optional_printf_string "notes" notes; + print_notes notes; printf " \"hidden\": %s\n" (json_string_of_bool hidden); printf " }%s\n" (trailing_comma i (List.length index)) ) index; -- 1.8.3.1