Ogre.DocAn Ogre document.
A concrete representation of a database.
type t = docinclude Core_kernel.Bin_prot.Binable.S with type t := tval bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (int -> t) Bin_prot.Read.readerval bin_writer_t : t Bin_prot.Type_class.writerval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.tval empty : docempty creates an empty document
val is_empty : doc -> boolis_empty x is true iff x is empty.
merge d1 d2 merges two documents in one. Returns an error, if documents contain inconsistent declarations.
val load : Core_kernel.In_channel.t -> doc Core_kernel.Or_error.tload chan loads a document from a channel, returns an error if a document is not well-formed, raises an exception if a system error has occurred.
val save : doc -> Core_kernel.Out_channel.t -> unitsave doc out stores the document in a channel. Raises an exception in case of a system error.
val from_file : string -> doc Core_kernel.Or_error.tfrom_file name reads a document from a file with the given name, returns an error, if a document is not well-formed, raises an exception if a system error has occurred.
val from_string : string -> doc Core_kernel.Or_error.tfrom_string data parses document from data. Returns an error if a document is not well-formed.
val to_string : doc -> stringto_string doc returns a textual representation of a document
val to_file : doc -> string -> unitto_file doc name stores a document to a file with the given name.
val pp : Stdlib.Format.formatter -> doc -> unitpp ppf doc prints a doc in the specified formatter ppf
val pp_yaml : Stdlib.Format.formatter -> doc -> unitpp_yamp ppf doc prints doc to ppf in the YAML format.
clear doc removes all facts from the document.
Useful for extracting scheme from a document.
val declarations : doc -> intdeclarations doc returns the number of declarations in the document
val definitions : doc -> intdefinitions doc returns the number of facts that defined in the document.