NAME
MarpaX::ESLIF::JSON::Encoder - ESLIF's JSON encoder interface
VERSION
version 6.0.33.2
DESCRIPTION
This is JSON's strict and relax encoder writen directly in MarpaX::ESLIF library.
There are two JSON modes:
- Strict
-
Encoder is strict, as per ECMA-404 The JSON Data Interchange Standard.
- Relax
-
Encoder is relax, i.e.:
- Infinity
-
+Infinity
and-Infinity
can appear in the output. - NaN
-
NaN
can appear in the output.
METHODS
MarpaX::ESLIF::JSON::Encoder->new($eslif[, $strict])
my $eslifJSONEncoder = MarpaX::ESLIF::JSON::Encoder->new($eslif);
Returns a JSON grammar instance, noted $eslifJSONEncoder
later. Parameters are:
$eslif
-
MarpaX::ESLIF object instance. Required.
$strict
-
A true value means strict JSON, else relax JSON. Default is a true value.
$eslifJSONEncoder->encode($value)
my $string = $eslifJSONEncoder->encode($value);
Returns a string containing encoded JSON data.
NOTES
Formally, the JSON implementation is only a grammar coded directly in the ESLIF library, therefore this module inherits from MarpaX::ESLIF::Grammar.
AUTHOR
Jean-Damien Durand <jeandamiendurand@free.fr>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Jean-Damien Durand.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.