ocaml: Add alternate object-oriented programming style.
In original style:
let () =
let filename = Sys.argv.(1) in
let g = Guestfs.create () in
Guestfs.add_drive_ro g filename;
Guestfs.launch g;
let roots = Guestfs.inspect_os g in
print_endline (Guestfs.inspect_get_product_name g roots.(0))
The same code in the new OO style:
let () =
let filename = Sys.argv.(1) in
let g = new Guestfs.guestfs in
g#add_drive_ro filename;
g#launch ();
let roots = g#inspect_os () in
print_endline (g#inspect_get_product_name roots.(0))