ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.pm
(Generate patch)

Comparing JSON-XS/XS.pm (file contents):
Revision 1.153 by root, Sun Mar 2 20:41:14 2014 UTC vs.
Revision 1.154 by root, Sun Mar 2 22:09:38 2014 UTC

1612 1612
1613And after decoding the JSON text, you could walk the data 1613And after decoding the JSON text, you could walk the data
1614structure looking for arrays with a first element of 1614structure looking for arrays with a first element of
1615C<XU1peReLzT4ggEllLanBYq4G9VzliwKF>. 1615C<XU1peReLzT4ggEllLanBYq4G9VzliwKF>.
1616 1616
1617The same approach cna be used to create the tagged format with another 1617The same approach can be used to create the tagged format with another
1618encoder. First, you create an array with the magic string as first member, 1618encoder. First, you create an array with the magic string as first member,
1619the classname as second, and constructor arguments last, encode it as part 1619the classname as second, and constructor arguments last, encode it as part
1620of your JSON structure, and then: 1620of your JSON structure, and then:
1621 1621
1622 $json =~ s/\[\s*"XU1peReLzT4ggEllLanBYq4G9VzliwKF"\s*,\s*("([^\\":,]+|\\.|::)*")\s*,/($1)[/g; 1622 $json =~ s/\[\s*"XU1peReLzT4ggEllLanBYq4G9VzliwKF"\s*,\s*("([^\\":,]+|\\.|::)*")\s*,/($1)[/g;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines