Matt S Trout > Rakudo-Star-2012.08_001 > rakudo-star/parrot/runtime/parrot/library/Config/JSON.pir

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

DESCRIPTION ^

Provides a simple wrapper to read and write JSON config files.

ReadConfig(filename)

Given a filename, parse the file containing valid JSON and return a PMC containing the data.

If the data is not valid, an exception will be thrown.

WriteConfig(config, filename, ?:compact)

Given a PMC and a filename, render the pmc as JSON and store the contents into the named file, overwriting the existing contents.

Any exceptions generated by the conversion or writing to the file will be passed through.

If a true value is passed for the optional named parameter 'compact', then the rendered JSON will not be formatted. The default is false.

syntax highlighting: