Group
Extension

Matches 6

Google-ProtocolBuffers-Dynamic ( M/MB/MBARBON/Google-ProtocolBuffers-Dynamic-0.43.tar.gz, MBARBON, 2024; MetaCPAN )
Google-ProtocolBuffers-Dynamic/scripts/profile.pl ( view source; MetaCPAN )
use strict;
use warnings;

use Benchmark qw(cmpthese);
use Sereal;
use JSON::XS ();
use JSON ();
use Google::ProtocolBuffers::Dynamic;
use Getopt::Long;

{
    my $d = Google::ProtocolBuffers::Dynamic

my $sereal_encoder = Sereal::Encoder->new;
my $sereal_decoder = Sereal::Decoder->new;
my $json_decoder = JSON::XS->new;

exit main();

sub main {
    my %suites = (
        decode_maps         => \&p
nchmarks = (
        bbpb    => 'protobuf_bbpb',
        upb     => 'protobuf_upb',
        json    => 'json',
        sereal  => 'sereal',
    );

    my $error;
    my $arg_ok = GetOptions(
        
Google-ProtocolBuffers-Dynamic ( M/MB/MBARBON/Google-ProtocolBuffers-Dynamic-0.43.tar.gz, MBARBON, 2024; MetaCPAN )
Google-ProtocolBuffers-Dynamic/lib/Google/ProtocolBuffers/Dynamic/Message.pod ( view source; MetaCPAN )
r binary data into a message instance.

=head2 decode_json

    $msg = Message::Class->decode_json($json_data);

Deserializes Protocol Buffer JSON data into a message instance.

=head2 encode

    $se
code_json

    $serialized_data = Message::Class->encode_json({ ... });
    $serialized_data = Message::Class->encode_json($message_instance);
    $serialized_data = $message_instance->encode_json;

S
izes the given message instance (or mix of message instances and
plain hashes) to Protocol Buffer JSON format.

=head2 check

    Message::Class->check({ ... });
    Message::Class->check($message_ins
Google-ProtocolBuffers-Dynamic ( M/MB/MBARBON/Google-ProtocolBuffers-Dynamic-0.43.tar.gz, MBARBON, 2024; MetaCPAN )
Google-ProtocolBuffers-Dynamic/src/dynamic.h ( view source; MetaCPAN )
Def;

struct MappingOptions {
    enum BoolStyle {
        Perl = 1,
        Numeric = 2,
        JSON = 3,
    };

    enum AccessorStyle {
        GetAndSet = 1,
        PlainAndSet = 2,
        Sin
Google-ProtocolBuffers-Dynamic ( M/MB/MBARBON/Google-ProtocolBuffers-Dynamic-0.43.tar.gz, MBARBON, 2024; MetaCPAN )
Google-ProtocolBuffers-Dynamic/src/mapper.h ( view source; MetaCPAN )
ude "ref.h"

#include <upb/pb/encoder.h>
#include <upb/pb/decoder.h>
#include <upb/json/printer.h>
#include <upb/json/parser.h>

#include "unordered_map.h"

#include "EXTERN.h"
#include "perl.h"
#incl
l on_numeric_bool(DecoderHandlers *cxt, const int *field_index, bool val);
        static bool on_json_bool(DecoderHandlers *cxt, const int *field_index, bool val);

        void push_mapper(const Map
 bufsize);
    SV *decode_bbpb(const char *buffer, STRLEN bufsize);
    SV *encode_json(SV *ref);
    SV *decode_json(const char *buffer, STRLEN bufsize);
    bool check(SV *ref);

    const char *las
Google-ProtocolBuffers-Dynamic ( M/MB/MBARBON/Google-ProtocolBuffers-Dynamic-0.43.tar.gz, MBARBON, 2024; MetaCPAN )
Google-ProtocolBuffers-Dynamic/lib/Google/ProtocolBuffers/Dynamic.pm ( view source; MetaCPAN )
;
    $person = Humans::Person->decode_json('{"id":31,"name":"John Doe"}');
    $bytes = Humans::Person->encode($person);
    $bytes = Humans::Person->encode_json($person);

    # field accessors
    
 C<"">.

=item numeric

Maps C<true> to C<1> and C<false> to C<0>.

=item json

Loads L<JSON> and uses C<JSON::true> and C<JSON::false> as
C<true>/C<false> values.

=back

=head2 check_required_fields
Google-ProtocolBuffers-Dynamic ( M/MB/MBARBON/Google-ProtocolBuffers-Dynamic-0.43.tar.gz, MBARBON, 2024; MetaCPAN )
Google-ProtocolBuffers-Dynamic/scripts/benchmark.pl ( view source; MetaCPAN )
use strict;
use warnings;

use Benchmark qw(cmpthese);
use Sereal;
use JSON::XS ();
use JSON ();
use Google::ProtocolBuffers;
use Google::ProtocolBuffers::Dynamic;

Google::ProtocolBuffers->parsefile(
icPerson->encode($person);
my $sereal_person = $sereal_encoder->encode($person);
my $json_person = JSON::encode_json($person);

sub encode_protobuf_pp_one { Test::Person->encode($person); }
sub encode
de($person); }
sub encode_sereal_one { $sereal_encoder->encode($person); }
sub encode_json_one { JSON::encode_json($person); }

sub decode_protobuf_pp_one { Test::Person->decode($pbd_person); }
sub de

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