class rawConfigParser :Primary interface class for configuarion files.object
..end
Usage example:
let cp = new rawConfigParser in
cp#readfile "app.conf";
print_endline cp#get "sect1" "opt1";
let calc = (cp#getint "sect1" "intopt1") + (cp#getint "sect1" "intopt2")
method maingetdata : string -> string -> string
method sections : string list
DEFAULT
.method add_section : string -> unit
ConfigParser.DuplicateSectionError
if the section already exists. cp#add_section "foo"
will add the
section named "foo" to the object cp
.method has_section : string -> bool
cp#has_section "foo"
will
return true if that section is present.method options : string -> string list
method has_option : string -> string -> bool
cp#has_option "sectname" "optname"
.method readfile : string -> unit
method readchan : Pervasives.in_channel -> unit
method readstring : string -> unit
method get : ?default:string -> string -> string -> string
cp#get "sectname" "optname"
. If optname
cannot be found in the
given section sectname
, searches for that option name in the section
DEFAULT
. If it is still not found there and the optional
default argument is given, return that; otherwise, raises Not_found
.
The other get* functions share this behavior.method getint : ?default:int -> string -> string -> int
method getfloat : ?default:float -> string -> string -> float
method getbool : ?default:bool -> string -> string -> bool
method items : string -> (string * string) list
method set : string -> string -> string -> unit
cp#set "sectname" "optname" "newvalue"
method to_string : string
method writefile : string -> unit
method writechan : Pervasives.out_channel -> unit
method remove_option : string -> string -> bool
cp#remove_option "sectname" "optname"
method remove_section : string -> bool
DEFAULT
section. Returns true if something was removed; false
otherwise.method optionxform : string -> string
method optionxform oname = String.lowercase oname
.