Group
Extension

Matches 1

MARC-File-JSON ( C/CF/CFOUTS/MARC-File-JSON-0.001.tar.gz, CFOUTS, 2012; MetaCPAN )
MARC-File-JSON/lib/MARC/File/JSON.pm ( view source; MetaCPAN )
package MARC::File::JSON;

# ABSTRACT: read/write MARC data into JSON format

use strict;
use warnings;
use JSON;
use JSON::Streaming::Reader;
use MARC::Record::Generic;
use MARC::Record;
use MARC::Fi

push @ISA, 'MARC::File';

# MARC::Record -> JSON
sub encode {
    my $record = shift;
    return JSON->new->utf8->encode( $record->as_generic );
}

# JSON -> MARC::Record
sub decode {
    my ($self, 
    $data = JSON->new->utf8->decode( $data );
    }
    return MARC::Record->new_from_generic( $data );
}

sub _next {
    my $self = shift;
    my $jsonr
        = $self->{jsonr} //= JSON::Streaming:

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.